Skip to content

Commit

Permalink
fix(blend) fix green channel with additive blending
Browse files Browse the repository at this point in the history
kisvegabor committed Sep 30, 2021
1 parent c9d3965 commit 78158f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/draw/lv_draw_blend.c
Original file line number Diff line number Diff line change
@@ -969,6 +969,7 @@ static inline lv_color_t color_blend_true_color_additive(lv_color_t fg, lv_color
#endif

#if LV_COLOR_DEPTH == 8
tmp = bg.ch.green + fg.ch.green;
fg.ch.green = LV_MIN(tmp, 7);
#elif LV_COLOR_DEPTH == 16
#if LV_COLOR_16_SWAP == 0
@@ -982,6 +983,7 @@ static inline lv_color_t color_blend_true_color_additive(lv_color_t fg, lv_color
#endif

#elif LV_COLOR_DEPTH == 32
tmp = bg.ch.green + fg.ch.green;
fg.ch.green = LV_MIN(tmp, 255);
#endif

@@ -1028,4 +1030,4 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co
}
#endif

#endif // LV_USE_GPU_SDL_RENDER
#endif // LV_USE_GPU_SDL_RENDER

0 comments on commit 78158f0

Please sign in to comment.