From d62688a0ef0cf36f04cc91c2d8487159e2fc24e5 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 31 Mar 2023 02:14:51 -0700 Subject: [PATCH] Util: Fix extracting top channel from 565 formats --- src/util/image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/image.c b/src/util/image.c index c074c6b91..a0053b573 100644 --- a/src/util/image.c +++ b/src/util/image.c @@ -261,12 +261,12 @@ uint32_t mColorConvert(uint32_t color, enum mColorFormat from, enum mColorFormat break; case mCOLOR_RGB565: - r = (((color >> 10) & 0x1F) * 0x21) >> 2; + r = (((color >> 11) & 0x1F) * 0x21) >> 2; g = (((color >> 5) & 0x3F) * 0x41) >> 4; b = ((color & 0x1F) * 0x21) >> 2; break; case mCOLOR_BGR565: - b = (((color >> 10) & 0x1F) * 0x21) >> 2; + b = (((color >> 11) & 0x1F) * 0x21) >> 2; g = (((color >> 5) & 0x3F) * 0x41) >> 4; r = ((color & 0x1F) * 0x21) >> 2; break;