Prevent Red Channel from clobbering Green in color_blend_true_color_additive()
- In 8 and 32 bit mode, Red channel data would leak into Green
This commit is contained in:
@@ -815,11 +815,11 @@ static inline lv_color_t color_blend_true_color_additive(lv_color_t fg, lv_color
|
|||||||
fg.ch.red = LV_MATH_MIN(tmp, 255);
|
fg.ch.red = LV_MATH_MIN(tmp, 255);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
tmp = bg.ch.green + fg.ch.green;
|
||||||
#if LV_COLOR_DEPTH == 8
|
#if LV_COLOR_DEPTH == 8
|
||||||
fg.ch.green = LV_MATH_MIN(tmp, 7);
|
fg.ch.green = LV_MATH_MIN(tmp, 7);
|
||||||
#elif LV_COLOR_DEPTH == 16
|
#elif LV_COLOR_DEPTH == 16
|
||||||
#if LV_COLOR_16_SWAP == 0
|
#if LV_COLOR_16_SWAP == 0
|
||||||
tmp = bg.ch.green + fg.ch.green;
|
|
||||||
fg.ch.green = LV_MATH_MIN(tmp, 63);
|
fg.ch.green = LV_MATH_MIN(tmp, 63);
|
||||||
#else
|
#else
|
||||||
tmp = (bg.ch.green_h << 3) + bg.ch.green_l + (fg.ch.green_h << 3) + fg.ch.green_l;
|
tmp = (bg.ch.green_h << 3) + bg.ch.green_l + (fg.ch.green_h << 3) + fg.ch.green_l;
|
||||||
|
|||||||
Reference in New Issue
Block a user