If n is missing or non-zero, activate colors (this is the default); otherwise, turn it off.
The read-only number register
.coloris 1 if colors are active, 0 otherwise.Internally,
colorsets a global flag; it does not produce a token. Similar to thecprequest, 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 following values:
rgb(three components),cmy(three components),cmyk(four components), andgrayorgrey(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
#or##; the former specifies hex values in the range 0–255 (which are internally multiplied by 257), the latter in the range 0–65535. Examples:#FFC0CB(pink),##ffff0000ffff(magenta). The default color name value is device-specific (usually black). It is possible that the default color for\mand\Mis not identical.A new scaling indicator
fhas 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). Example:.defcolor darkgreen rgb 0.1f 0.5f 0.2fNote that
fis the default scaling indicator for thedefcolorrequest, 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.The escape
\m[]returns to the previous color, as does a call togcolorwithout 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).
Note that
\mdoesn't produce an input token ingtroff. As a consequence, it can be used in requests likemc(which expects a single character as an argument) to change the color on the fly:.mc \m[red]x\m[]
Set fill (background) color for filled objects drawn with the
\D'...'commands.A red ellipse can be created with the following code:
\M[red]\h'0.5i'\D'E 2i 1i'\M[]The escape
\M[]returns to the previous fill color, as does a call tofcolorwithout 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).
Note that
\Mdoesn't produce an input token ingtroff.