Search


Ploticus > Scripts >
colors


color specifications control the color of lines, filled areas, and text. colors





How to specify a color

Colors may be specified by pre-defined name, by RGB specification, hexadecimal specification (like HTML), or by gray level specification. Hatch patterns may also be used as colors, for rectangular areas such as bars. With PostScript/EPS, you can also use CMYK and HSB specifications. With PNG, GIF, or EPS, the special color transparent may be used as a background color.

The total length of a color specification string cannot be longer than 38 characters.




Predefined color names

See the illustration above.




Custom RGB specifications

If none of the pre-named colors suit, a custom RGB specification in the form of rgb(R,G,B) may be used. R, G, B are values from 0.0 to 1.0 (1.0 is brightest) specify the red, green and blue components. No embedded spaces are allowed. The values may be separated by a comma (as above), or by colon (:), dash (-), or pipe (|).

Example: rgb(0.4,0.84,0.37)




Hexadecimal RGB specifications

Similarly to HTML, you can use 6 or 12 digit hexadecimal RGB color values.

Example: xA0FFA0,

Example: xAA00FFFFAA00.

The older notation eg. xrgb(A0FFA0) can also be used.




Gray-level specifications

A gray-level specification in the form of gray(G) or just G, where G is 0.0-1.0 grey level (1.0 is white). No embeddded spaces are allowed.

PostScript printers can vary considerably as to the relative darkness of a rendered grey area.

Example: gray(0.8)




Custom HSB specifications

HSB color specifications are valid only with PostScript / EPS. An HSB (hue saturation and brightness) specification in the form of hsb(H,S,B), where R, G, B are values from 0.0 to 1.0. No embedded spaces are allowed. The values may be separated by a comma (as above), or by colon (:), dash (-), or pipe (|).




Custom CMYK specifications

CMYK color specifications are valid only with PostScript / EPS. A CMYK (cyan, magenta, yellow, black) specification in the form of cmyk(C,M,Y,K) where C, M, Y, and K are values from 0.0 through 1.0. No embedded spaces are allowed. The values may be separated by a comma (as above), or by colon (:), dash (-), or pipe (|).




Hatch patterns

Hatch patterns may be used as colors to fill rectangular areas such as bars. These are most useful when rendering in PostScript for monochrome hard copy, for situations where the available gray-level gradations do not provide enough distinct variations. Hatch patterns are specified in the form of hatchn where n is 1 - 9. hatch1 is the lightest and hatch9 is the darkest. The hatch line color is always black. Hatch patterns may only be used to fill rectangular areas such as bars; they won't work for pie graphs or rangesweeps.


 


Ploticus 2.42 ... May 2013 Terms of use /