trnsystor.utils.get_rgb_from_int

trnsystor.utils.get_rgb_from_int(rgb_int)[source]

Convert an rgb int color to its red, green and blue colors.

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 tuple from a an rgb int.

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

rgb_int (int) – An rgb int representation.

Returns

(r, g, b) tuple.

Return type

(tuple)