From 515aa881cc26bc302bada4b705cf2ffdf5e1bcd8 Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 30 Oct 2020 01:11:43 -0400 Subject: [PATCH] ncpixel_b/ncpixel_g: fix for RGBA --- include/notcurses/notcurses.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/notcurses/notcurses.h b/include/notcurses/notcurses.h index 441b109a1..34c1a08cf 100644 --- a/include/notcurses/notcurses.h +++ b/include/notcurses/notcurses.h @@ -2422,13 +2422,13 @@ ncpixel_r(uint32_t pixel){ // Extract the 8-bit green component from a pixel static inline unsigned ncpixel_g(uint32_t pixel){ - return (pixel & 0x00ff0000ul) >> 16u; + return (pixel & 0x0000ff00ul) >> 8u; } // Extract the 8-bit blue component from a pixel static inline unsigned ncpixel_b(uint32_t pixel){ - return (pixel & 0x0000ff00ul) >> 8u; + return (pixel & 0x00ff0000ul) >> 16u; } // Set the 8-bit alpha component of a pixel