Specifying Colours

Many properties and methods accept a colour as a 4-byte integer that combines the red, green, and blue components.

In Python you can build that integer with a small helper:

def rgb(red: int, green: int, blue: int) -> int:
    return (blue & 0xFF) | ((green & 0xFF) << 8) | ((red & 0xFF) << 16)

yellow = rgb(255, 255, 0)
light_grey = rgb(240, 240, 240)

Hex values are also supported. The byte order is blue, green, red—for example, 0x00FFFF produces yellow because blue and green are both set to 255.

The ipColour enumeration provides a handful of predefined colours (black, white, red, green, blue).