summaryrefslogtreecommitdiffstats
path: root/core/color.cpp
diff options
context:
space:
mode:
authortoger5 <toger5@hotmail.de>2017-08-30 20:30:12 +0200
committertoger5 <toger5@hotmail.de>2017-08-30 21:20:01 +0200
commit426c6b2c499055259f2542c180f996866dc26b17 (patch)
treeaaaef6cb555e91e174c2cee3db2415122b1389d8 /core/color.cpp
parentc8448cb0ac7ca6562e2fc539ee2f791ccd3547c6 (diff)
downloadredot-engine-426c6b2c499055259f2542c180f996866dc26b17.tar.gz
added to_ABGR32() to core/Color
Diffstat (limited to 'core/color.cpp')
-rw-r--r--core/color.cpp12
1 files changed, 12 insertions, 0 deletions
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);