diff --git a/lv_conf_template.h b/lv_conf_template.h index 1feb55050..238764ea8 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -36,7 +36,7 @@ /* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently. * 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */ -#define LV_COLOR_MIX_ROUND_OFS (LV_COLOR_DEPTH == 32 ? 0: 128) +#define LV_COLOR_MIX_ROUND_OFS 0 /*Images pixels with this color will not be drawn if they are chroma keyed)*/ #define LV_COLOR_CHROMA_KEY lv_color_hex(0x00ff00) /*pure green*/ diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index 0753c605c..83633506f 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -96,7 +96,7 @@ #ifdef CONFIG_LV_COLOR_MIX_ROUND_OFS #define LV_COLOR_MIX_ROUND_OFS CONFIG_LV_COLOR_MIX_ROUND_OFS #else - #define LV_COLOR_MIX_ROUND_OFS (LV_COLOR_DEPTH == 32 ? 0: 128) + #define LV_COLOR_MIX_ROUND_OFS 0 #endif #endif diff --git a/src/misc/lv_color.h b/src/misc/lv_color.h index ab3447ed6..e994ff236 100644 --- a/src/misc/lv_color.h +++ b/src/misc/lv_color.h @@ -440,7 +440,7 @@ LV_ATTRIBUTE_FAST_MEM static inline lv_color_t lv_color_mix(lv_color_t c1, lv_co { lv_color_t ret; -#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP == 0 +#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP == 0 && LV_COLOR_MIX_ROUND_OFS == 0 /*Source: https://stackoverflow.com/a/50012418/1999969*/ mix = (mix + 4) >> 3; uint32_t bg = (uint32_t)((uint32_t)c2.full | ((uint32_t)c2.full << 16)) &