Commit 59099455 authored by Stefan Haun's avatar Stefan Haun
Browse files

Fix RGB888 to RGB565 conversion

according to https://afterthoughtsoftware.com/posts/convert-rgb888-to-rgb565
parent c1899be2
Pipeline #4142 passed with stages
in 51 seconds
......@@ -1296,9 +1296,9 @@ enum disp_fillstyle {
* :return: RGB565 color
*/
#define COLOR_TO_565(c) \
((COLOR_GET_RED(c) >> 3) | \
(COLOR_GET_GREEN(c) >> 2) | \
(COLOR_GET_BLUE(c) >> 3))
((((COLOR_GET_RED(c) >> 3) & 0x1f) << 11) | \
(((COLOR_GET_GREEN(c) >> 2) & 0x3f) << 5) | \
((COLOR_GET_BLUE(c) >> 3) & 0x1f))
/** CCCamp 2019 Color CHAOSBLUE */
#define COLOR_CHAOSBLUE 0x0076ba
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment