summaryrefslogtreecommitdiff
path: root/libkmstest
diff options
context:
space:
mode:
Diffstat (limited to 'libkmstest')
-rw-r--r--libkmstest/color.cpp5
-rw-r--r--libkmstest/color.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/libkmstest/color.cpp b/libkmstest/color.cpp
index 3ad8203..490ff64 100644
--- a/libkmstest/color.cpp
+++ b/libkmstest/color.cpp
@@ -29,6 +29,11 @@ RGB::RGB(uint32_t argb)
this->a = (argb >> 24) & 0xff;
}
+uint32_t RGB::rgb888() const
+{
+ return (r << 16) | (g << 8) | (b << 0);
+}
+
uint32_t RGB::argb8888() const
{
return (a << 24) | (r << 16) | (g << 8) | (b << 0);
diff --git a/libkmstest/color.h b/libkmstest/color.h
index f99a951..ef85a67 100644
--- a/libkmstest/color.h
+++ b/libkmstest/color.h
@@ -13,6 +13,7 @@ struct RGB
RGB(uint8_t a, uint8_t r, uint8_t g, uint8_t b);
RGB(uint32_t argb);
+ uint32_t rgb888() const;
uint32_t argb8888() const;
uint32_t abgr8888() const;
uint16_t rgb565() const;