INPUT /  OUTPUT /  LANGUAGE






color field

Category: scalar field

Applies a foreground color to a presentation tag.

Applies to...

box, button, checkBox, choiceBox, clientFrame, ellipse, img, input, line, span, table, tabRow, video

Note: for a clientFrame object, the color field is set by the inner client application itself.

Sample usage

Behaviour

The specified color value in the color field is applied to text within the tag, and inherited as the default foreground and border color used by other presentation tags within this tag.

If color is left undefined or set to null, the foreground color of the parent presentation tag is used.

Specifying a color value for this field

This field accepts a color value expressed either as a text keyword or a numerical color value represented in hexadecimal notation.

A value of null may be used to represent the absence of a specified color. This is useful for resetting an element to its default appearance, or for constructing a tag with a color field without specifying an initial color.

Color keywords

Examples of valid colors in text notation are {black}, {white}, {blue}, {yellow}, and {orange}. ioL accepts any of the color keywords defined by the SVG 1.1 standard specification.

Hexadecimal colors

You can specify any color in the full 24-bit color spectrum by specifying the color's numerical value directly. Color values are 6-digit hexadecimal values, where each pair of digits ranges from x00 to xFF and refers to the color's red, green and blue component respectively.

Examples:

Hexadecimal color values in ioL

6-digit Hexadecimal numbers are often used to represent color values—on the web and elsewhere—because the codes match up neatly with the 24-bit color encoding used by most computers today.

Unlike regular "base 10" numbers that only use ten different symbols (from 0-9) to represent numbers, hexadecimal numbers use the symbols A-F as well, to allow 16 possible values per digit.
In ioL, a hexadecimal number begins with a lowercase x and then uses the digits 0-9 and A-F to represent a number.

Hexadecimal digits A-F must be UPPERCASE or ioL won't recognise the value as a number. For example, xB2 is a valid number but xb2 would be treated by ioL as an identifier.

How to convert from web colors to ioL color values

Sample color palettes available online often provide colours in hexadecimal notation. However, please note that ioL requires hexadecimal digits to be written in UPPERCASE with a x (not #) prefix. While the web notation is slightly different, the values themselves are the same. See the table below for examples on how to convert web colors into ioL colors.

Web color notationEquivalent ioL notation
#94c2bf x94C2BF
#ffffff xFFFFFF
#93a1a1 x93A1A1
Remember that these are numbers, not strings. Do not use braces { } around hexadecimal values.