trnsystor.utils.get_int_from_rgb

trnsystor.utils.get_int_from_rgb(rgb)[source]

Convert an RBG color to its TRNSYS Studio compatible int color.

Values are used ranging from 0 to 255 for each of the components.

Important

Unlike Java, the TRNSYS Studio will want an integer where bits 0-7 are the blue value, 8-15 the green, and 16-23 the red.

Examples

Get the rgb int from an rgb 3-tuple

>>> get_int_from_rgb((211, 122, 145))
9534163
Parameters

rgb (tuple) – The red, green and blue values. All values assumed to be in range [0, 255].

Returns

the rgb int.

Return type

(int)