mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-30 23:51:54 +08:00
fix lv_cpicker_set_color with 16 bit color depth and byte swap
Fixes #1257
This commit is contained in:
@@ -275,7 +275,12 @@ bool lv_cpicker_set_hsv(lv_obj_t * cpicker, lv_color_hsv_t hsv)
|
|||||||
*/
|
*/
|
||||||
bool lv_cpicker_set_color(lv_obj_t * cpicker, lv_color_t color)
|
bool lv_cpicker_set_color(lv_obj_t * cpicker, lv_color_t color)
|
||||||
{
|
{
|
||||||
|
#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP != 0
|
||||||
|
uint8_t green = (color.ch.green_h << 3) + color.ch.green_l;
|
||||||
|
return lv_cpicker_set_hsv(cpicker, lv_color_rgb_to_hsv(color.ch.red, green, color.ch.blue));
|
||||||
|
#else
|
||||||
return lv_cpicker_set_hsv(cpicker, lv_color_rgb_to_hsv(color.ch.red, color.ch.green, color.ch.blue));
|
return lv_cpicker_set_hsv(cpicker, lv_color_rgb_to_hsv(color.ch.red, color.ch.green, color.ch.blue));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user