From c9027b1a1a3d2cfe88363691dd586fe62d90fb83 Mon Sep 17 00:00:00 2001 From: tychovrahe Date: Fri, 17 May 2024 15:03:04 +0200 Subject: [PATCH] fix(core): fix alpha component extraction [no changelog] --- core/embed/lib/gfx_color.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/embed/lib/gfx_color.h b/core/embed/lib/gfx_color.h index 225898098..9df362c85 100644 --- a/core/embed/lib/gfx_color.h +++ b/core/embed/lib/gfx_color.h @@ -76,7 +76,7 @@ typedef uint32_t gfx_color32_t; // Extracts blue component from gfx_color32_t #define gfx_color32_to_b(c) (((c) & 0x000000FF) >> 0) // Extracts alpha component from gfx_color32_t -#define gfx_color32_to_a(c) (((c) & 0xFF000000) >> 0) +#define gfx_color32_to_a(c) (((c) & 0xFF000000) >> 24) // 4-bit linear interpolation between `fg` and `bg` #define a4_lerp(fg, bg, alpha) (((fg) * (alpha) + ((bg) * (15 - (alpha)))) / 15)