Closed klein0r closed 1 year ago
It is the raw RGB565 value (16-bit color) wich is the converted RGB888 (24-bit color) youve sent. In this format, your #0000FF blue color converts to a value of 31 (or 1F in hexadecimal), not 255.
The RGB565 color bitmask is rrrrrggg:gggbbbbb: red - 5 bit (0-31) in MSB, green - 6 bit (0-63), blue - 5 bit (0-31) in LSB.
Convertingfunction: https://github.com/Blueforcer/awtrix-light/blob/d4e34c74ed127cb05d484aff6e5006e6e72b187e/src/Functions.h#L83-L95
Awtrix essentially "shrink" the color's range from 0-255 (8-bit) to 0-31 (5-bit): The blue component in the RGB888 representation is FF, which equals to 255 in decimal. To convert this to a 5-bit number, we divide 255 by the maximum 8-bit number (255), and multiply by the maximum 5-bit number (31): (255 / 255) * 31 = 31
Du kannst auch gerne mal den discord server joinen, da können wir für deine Integration in einem eigenen thread evtl enger zusammenarbeiten
Question
How does the conversion from hex to int work?
When setting
TCOL
to#0000FF
, the settings endpoint return31
for that value (instead of255
). How does the conversion works?Additional information
Logs