|
GlowBit.py
|
Methods for transforming colours to 32-bit packed GlowBit colour values. More...

Public Member Functions | |
| def | wheel (self, pos) |
| Converts an integer "colour wheel position" to a packed 32-bit RGB GlowBit colour value. More... | |
| def | rgbColour (self, r, g, b) |
| Converts the r, g, and b integer arguments to a packed 32-bit RGB GlowBit colour value. More... | |
| def | glowbitColour2RGB (self, colour) |
| Converts a 32-bit GlowBit colour value to an (R,G,B) tuple. More... | |
| def | red (self) |
| Returns the GlowBit colour value for pure red. | |
| def | green (self) |
| Returns the GlowBit colour value for pure green. | |
| def | blue (self) |
| Returns the GlowBit colour value for pure blue. | |
| def | yellow (self) |
| Returns the GlowBit colour value for yellow. | |
| def | purple (self) |
| Returns the GlowBit colour value for purple. | |
| def | cyan (self) |
| Returns the GlowBit colour value for cyan. | |
| def | white (self) |
| Returns the GlowBit colour value for white. | |
| def | black (self) |
| Returns the GlowBit colour value for black. | |
Methods for transforming colours to 32-bit packed GlowBit colour values.
A packed 32-bit GlowBit colour is an integer with 8-bits per colour channel data encoded in hexadecimal as follows:
0x00RRGGBB
where RR, GG, and BB are hexadecimal values (decimal [0,255]) and the most significant 8 bits are reserved and left as zero.
| def glowbit.colourFunctions.glowbitColour2RGB | ( | self, | |
| colour | |||
| ) |
Converts a 32-bit GlowBit colour value to an (R,G,B) tuple.
| colour | A 32-bit GlowBit colour value |
| def glowbit.colourFunctions.rgbColour | ( | self, | |
| r, | |||
| g, | |||
| b | |||
| ) |
Converts the r, g, and b integer arguments to a packed 32-bit RGB GlowBit colour value.
All arguments are required as this is a micropython viper function.
| r | The red intensity, [0,255] |
| g | The green intensity, [0,255] |
| b | The blue intensity, [0,255] |
| def glowbit.colourFunctions.wheel | ( | self, | |
| pos | |||
| ) |
Converts an integer "colour wheel position" to a packed 32-bit RGB GlowBit colour value.
The "pos" argument is required as this is a micropython viper function.
| pos | Colour wheel position [0,255] is mapped to a pure hue in the RGB colourspace. A value of 0 or 255 is mapped to pure red with a smooth red-yellow-green-blue-purple-magenta-red transion for other values. |
1.8.13