color

A color.

Signatures

  • rgb( int red, int green, int blue )
  • cmyk( int cyan, int magenta, int yellow, int key )

Details

This data type represents a general color in one of the used color models RGB or CMYK).

A color variable keeps the color model it was constructed with but gets converted automatically when elements of a different color model are requested.

A color can be applied as a modifier onto a solid.

Example

 color c = rgb( 255, 0, 255 )
 make c >> box()
 

Casts To

string
modifier

Members

string cmode

Allows to read the color mode. This is either "rgb" or "cmyk".

int r

Allows to read/write the red value of the color.

int g

Allows to read/write the green value of the color.

int b

Allows to read/write the blue value of the color.

int c

Allows to read/write the cyan value of the color.

int m

Allows to read/write the magenta value of the color.

int y

Allows to read/write the yellow value of the color.

int k

Allows to read/write the key (black) value of the color.

Parameters

red

The red value of the RGB color model (0...255).

green

The green value of the RGB color model (0...255).

blue

The blue value of the RGB color model (0...255).

cyan

The cyan value of the CMYK color model (0...255).

magenta

The magenta value of the CMYK color model (0...255).

yellow

The yellow value of the CMYK color model (0...255).

key

The key (black) value of the CMYK color model (0...255).

See also