Fixing +/- 3 conversion problem

This commit is contained in:
Paul Peavyhouse
2019-10-16 22:41:56 -07:00
parent e0ca7581ef
commit 92be109cba

View File

@@ -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 - 3 ) >> 2;
ret.ch.green = ( color.ch.green * 4 + 3 );
ret.ch.blue = ( color.ch.blue * 33 - 3 ) >> 2;
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.alpha = 0xFF;
return ret.full;
#else