Fully tested values 5 bit red/blue 0 to 31 and 6 bit green 0 to 63
This commit is contained in:
@@ -310,9 +310,9 @@ static inline uint32_t lv_color_to32(lv_color_t color)
|
||||
* Truly any of the listed multipliers and adders would work.
|
||||
* The below numbers seem the most precise.
|
||||
*/
|
||||
ret.ch.red = ( color.ch.red * 33 ) >> 2;
|
||||
ret.ch.green = ( color.ch.green * 4 );
|
||||
ret.ch.blue = ( color.ch.blue * 33 ) >> 2;
|
||||
ret.ch.red = ( color.ch.red * 8423 + 7 ) >> 10;
|
||||
ret.ch.green = ( color.ch.green * 259 + 3 ) >> 6;
|
||||
ret.ch.blue = ( color.ch.blue * 8423 + 7 ) >> 10;
|
||||
ret.ch.alpha = 0xFF;
|
||||
return ret.full;
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user