Skip to content
Alan edited this page Jul 6, 2019 · 5 revisions

Basic diagram syntax

<diagram>
This is a diagram
</diagram>

Colors

Foreground colors:

<diagram>
This is a [#f00]diagram
</diagram>

(the word "diagram" is displayed in red)

Foreground colors:

<diagram>
This is a [@f00]diagram
</diagram>

(the word "diagram" is highlighted in red)

Default colors

<diagram fg="#0f0">
This is a diagram
</diagram>

(the entire diagram is displayed in green)

<diagram bg="#0f0">
This is a diagram
</diagram>

(the entire diagram's background is green)

Default default colors

The foreground color defaults to 7:0, or #c0c0c0. The background color defaults to 0:0, or #000000.

Resetting colors

  • [#] resets the foreground color to the default (specified in the <diagram> tag's attributes; falls back to default otherwise).
  • [@] resets the background color.
  • [@#] and [@#] reset both.

Using DF colors

The 16 DF colors are automatically translated into HTML colors (in the form 0-7:0-1). The colors are listed here, taken from Color.php:

// Standard DF colors
$DFCOLORS = array(
	'0:0' => '#000000',
	'0:1' => '#505050',
	'1:0' => '#000080',
	'1:1' => '#0000ff',
	'2:0' => '#c0c0c0',
	'2:1' => '#00ff00',
	'3:0' => '#008080',
	'3:1' => '#00ffff',
	'4:0' => '#800000',
	'4:1' => '#ff0000',
	'5:0' => '#800080',
	'5:1' => '#ff00ff',
	'6:0' => '#808000',
	'6:1' => '#ffff00',
	'7:0' => '#c0c0c0',
	'7:1' => '#ffffff'
);