Color
Any one of the following:
- Hexadecimal. A color represented as #RRGGBB; a hash sign followed by 6 hexadecimal digits, a pair for the intensity level 0 to 250 in hexadecimal of Red, Green and Blue. This is the same format used for describing colors in HTML. Example:
#A482BF. The short form is also accepted, e.g. #f00 for #ff0000 - where the two hex characters of each per-color value are identical and the second character is omitted. From v5.7.0, bare hex strings in action code - i.e. unquoted numbers preceded by a hash sign - are correctly identified as hex input values - Named Colors. The name of a color that either comes pre-defined in Tinderbox, or which you have defined for this Tinderbox document using the Colors pane of the attribute palette. Examples: blue, red, minty-fresh-green. When setting a shade of a named color in a string the shade value (lighter, darkest, etc.) comes before the color, unlike listings in Info view and the Rename dialog; thus "dark warm gray" not "warm gray dark", "light cyan" not "cyan light".
- HSV (Hue-Saturation-Value) value. Hue - a value from 0 to 360 degrees; Saturation and Value - a value from 0 to 100 percent. Enclosed in parentheses and preceded by 'hsv'. Examples:
"hsv(0,100,50)","hsv(240,80,80)". - RGB (Red-Green-Blue). Intensity levels represented as integers from 0 to 250. Enclosed in parentheses and preceded by 'rgb'. Examples:
"rgb(0,0,0)"and"rgb(68,153,68)". This should not be confused with the rgb() action operator (which sets a hex format value string (see first bullet above).
If no default value is specified, a Color type defaults to an empty string (which is treated by Tinderbox as the value 'normal'); in key attribute displays a white color chip is displayed. In some cases, Tinderbox will show a dark red color as a 'not initialised' color value; it is hex color code #6f0000, though its derivation as a value is not clear.
Note that as 8-bit color settings are translated within the app into 16-bit colors, rounding errors can occur. So, in some cases - most likely using HSV and HSV based transforms - the values used might not correspond precisely to those set by the user.
When accessed by ^get()^ or ^getFor()^ export codes, the colour is always returned as a hex figure including a # prefix, e.g. "#FF9900". Similarly, using format() with a colour attribute will always result in a hexadecimal value string regardless of the stored value. Note that coercing a default (blank) color to a string value using format() will result in the color value "#ffffff", which is not strictly the blank value so be wary of using that as a means to check a blank color value; better is to use a short form Boolean test.
Listing of Color-type system attributes.
