From 426c6b2c499055259f2542c180f996866dc26b17 Mon Sep 17 00:00:00 2001 From: toger5 Date: Wed, 30 Aug 2017 20:30:12 +0200 Subject: added to_ABGR32() to core/Color --- core/color.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'core/color.cpp') diff --git a/core/color.cpp b/core/color.cpp index 356e8c168c..ab264d31d4 100644 --- a/core/color.cpp +++ b/core/color.cpp @@ -47,6 +47,18 @@ uint32_t Color::to_ARGB32() const { return c; } +uint32_t Color::to_ABGR32() const { + uint32_t c = (uint8_t)(a * 255); + c <<= 8; + c |= (uint8_t)(b * 255); + c <<= 8; + c |= (uint8_t)(g * 255); + c <<= 8; + c |= (uint8_t)(r * 255); + + return c; +} + uint32_t Color::to_32() const { uint32_t c = (uint8_t)(a * 255); -- cgit v1.2.3