From c9af2395165f80e2206a445f96e8f576bdf82836 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Sun, 30 Oct 2016 07:46:18 +0100 Subject: [PATCH] fix: Widen color channels --- include/components/x11/color.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/components/x11/color.hpp b/include/components/x11/color.hpp index 2c2de377..1f0c04b9 100644 --- a/include/components/x11/color.hpp +++ b/include/components/x11/color.hpp @@ -47,19 +47,19 @@ class color { } uint32_t alpha() const { - return 0xFF & (value() >> 24); + return 0xFFFF & (((value() >> 24)) | ((value() >> 24))); } uint32_t red() const { - return 0xFF & (rgb() >> 16); + return 0xFFFF & (((value() >> 16) << 8) | ((value() >> 16))); } uint32_t green() const { - return 0xFF & (rgb() >> 8); + return 0xFFFF & (((value() >> 8) << 8) | ((value() >> 8))); } uint32_t blue() const { - return 0xFF & rgb(); + return 0xFFFF & ((value() << 8) | value()); } string hex_to_rgb() const {