From d9b3c672fdcbc9b02db6d15fccb4dd70eb77090d Mon Sep 17 00:00:00 2001 From: Themba Dube Date: Sat, 24 Apr 2021 20:28:09 -0400 Subject: [PATCH] fix(color) fix off-by-one error --- src/misc/lv_color.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc/lv_color.c b/src/misc/lv_color.c index a85c2b9be..8cfb18c1e 100644 --- a/src/misc/lv_color.c +++ b/src/misc/lv_color.c @@ -358,8 +358,8 @@ lv_color_t lv_palette_darken(lv_palette_t p, uint8_t lvl) return lv_color_black(); } - if(lvl == 0 || lvl > 5) { - LV_LOG_WARN("Invalid level: %d. Must be 1..5", lvl); + if(lvl == 0 || lvl > 4) { + LV_LOG_WARN("Invalid level: %d. Must be 1..4", lvl); return lv_color_black(); }