If n is missing or non-zero, activate colors (this is the default); otherwise, turn it off.
The read-only number register
.color is 1 if colors are
active, 0 otherwise.
color sets a global flag; it does not produce a
token. Similar to the
cp request, you should use it at the
beginning of your document to control color output.
Colors can be also turned off with the -c command-line option.
Define color with name ident. scheme can be one of the
rgb (three components),
cmyk (four components), and
grey (one component).
Color components can be given either as a hexadecimal string or as
positive decimal integers in the range 0–65535. A hexadecimal string
contains all color components concatenated. It must start with either
##; the former specifies hex values in the range
0–255 (which are internally multiplied by 257), the latter in the
range 0–65535. Examples:
(magenta). The default color name value is device-specific (usually black). It is possible that the
default color for
\M is not identical.
A new scaling indicator
f has been introduced, which
multiplies its value by 65536; this makes it convenient to specify color
components as fractions in the range 0 to 1 (1f equals 65536u).
.defcolor darkgreen rgb 0.1f 0.5f 0.2f
f is the default scaling indicator for the
defcolor request, thus the above statement is equivalent to
.defcolor darkgreen rgb 0.1 0.5 0.2
Set (glyph) drawing color. The following examples show how to turn the next four words red.
.gcolor red these are in red .gcolor and these words are in black.
\m[red]these are in red\m and these words are in black.
\m returns to the previous color, as does a call to
gcolor without an argument.
The name of the current drawing color is available in the read-only, string-valued number register ‘.m’.
The drawing color is associated with the current environment (see Environments).
\m doesn’t produce an input token in
a consequence, it can be used in requests like
mc (which expects
a single character as an argument) to change the color on the fly:
Set fill (background) color for filled objects drawn with the
A red ellipse can be created with the following code:
\M[red]\h'0.5i'\D'E 2i 1i'\M
\M returns to the previous fill color, as does a
fcolor without an argument.
The name of the current fill (background) color is available in the read-only, string-valued number register ‘.M’.
The fill color is associated with the current environment (see Environments).
\M doesn’t produce an input token in