# Color Operators

#### Color Components

Color.red

Color.green

Color.blue

Three read/write properties allow the individual RGB color channel values to be read or set. The component value is a number (0-255). Values may set using a number 0-255 or a hex number string "#00" - "#ff".

> `$MyNumber=$Color.red`

> `$Color.red = 255`

Color.brightness - Read/write property allows a color's brightness level to be read or set using a value in the 0-100 range representing a percentage.

Color.saturation - Read/write property allows a color's saturation level to be read or set using a value in the 0-100 range representing a percentage.

Color.hue - Read/write property allow a color's hue to be read or set using a value in the 0-360 range representing a a circular degree.

#### Converting Colors to Strings

Color.format() - converts a color attribute to a string representation.

#### Converting Strings to Colors

Tinderbox provides several flexible notations for interpreting colors.

Named colors are the preferred way to set and change colors in Tinderbox. Named colors may be redefined, and new named colors added or deleted, in the Colors pane of the Document Inspector.

Hex colors, customarily used on the Web, begin with a # sign followed by six hexadecimal digits: #rrggbb, corresponding to the proportion of red, green, and blue in the color. #FFFFFF is white, #800000 is dark red, and #000000 is black.

RGB colors of the form RGB(red,green,blue) use decimal colors from 0 to 255 to describe the proportion of red, green, and blue in the color.

HSV colors of the form HSV(hue,saturation,value) describe the hue, saturation, and value of the color. Hue is a color wheel angle, in degrees, running from 0 to 360. 0 corresponds to red, 120 to blue, and 240 to green. Saturation and value run from 0 to 100. The value is the equivalent to brightness in HSB(hue, saturation, brightness)

#### Manipulating Colors

rgb(red,green,blue) -creates a color. Its arguments are integers ranging from 0 to 255. Arguments may also be expressions or attribute references.

> `$Color=rgb($MyRed,255,255)`