![]() |
|
Navigation |
Synopsis The model used for defining colors.
Types
alias Color = int;
Description A color is expressed in the RGB color space and consists of a red, green and blue
ingredient; each can have a value in the range [0-255].
In addition, colors can have a transparency, expressed as a percentage
between 0.0 (completely opaque) and 1.0 (completely transparent).
One can also refer to colors by name. The full range of
X11 (HTML) Colors
![]() A color can be constructed using:
Examples
b1 = box([size(50), fillColor("MidNightBlue")]); render(b1);displays: ![]() We can also use the RGB value of MidNightBlue directly b2 = box([size(50), fillColor(rgb(25,25,112))]); render(b2);and obtain (unsurprisingly) the same result: ![]() ![]() |