Documentation‎ > ‎Concepts‎ > ‎

Colours

Some widget options expect a colour as value. A colour can be given in several different formats.

Colour formats

  1. Colour Name

    A colour name from rgb.txt like red, LightPink, or DarkKhaki.

  2. RGB values as integer

    A list of the red, green and blue components. Each value must be an integer between 0 and 65535. It may be convenient to use the hexadecimal format, in which the maximum is 0xFFFF.

  3. RGB values as float

    A list of the red, green and blue components. Each value must be an float between 0 and 1.

    The values are tested first for an integer format. Only if a value does not have an integer format, the float format is tested. That means, that "1" is an integer with a value corresponding to "0.000015", whereas "1." is interpreted as a floating point number with a value corresponding to integer 65535.

    Some widget options expect a colour with transparency (also called alpha blending) as value. An alpha value of 0 means that the colour is completely transparent, 1.0 in float or 65535 as integer means it covers its background completely. The same formats than above are excepted, in which case the color has no transparency, plus the following ones.

Transparency

  1. Colour Name plus transparency

    A list of a colour name from rgb.txt and a transparency value between 0 and 65535 as integer or 0 and 1.0 as float like "red 32768", "LightPink 0x1000", or "DarkKhaki 0.9".

  2. RGBA values as integer

    A list of the red, green, blue and alpha components. Each value must be an integer between 0 and 65535, for example "3000 10000 20000 15000". It may be convenient to use the hexadecimal format, in which the maximum is 0xFFFF.

  3. RGBA values as float

    A list of the red, green, blue and alpha components. Each value must be an integer between 0 and 1.0, for example "0.1 0.3 0.3 0.5". 

    The values are tested first for an integer format. Only if a value does not have an integer format, the float format is tested. That means, that "1" is an integer with a value corresponding to "0.000015", whereas "1." is interpreted as a floating point number with a value corresponding to integer 65535.

Empty string

The empty string means full transparency.



Comments