fix lv_cpicker_set_color with 16 bit color depth and byte swap

Fixes #1257
This commit is contained in:
Gabor Kiss-Vamosi
2019-11-10 10:45:49 +01:00
parent 45c6dbab62
commit 6f762bb7c7

View File

@@ -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)
{
#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));
#endif
}
/**