summaryrefslogtreecommitdiff
path: root/src/helpers/Color.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-04-05 21:23:06 +0100
committerVaxry <vaxry@vaxry.net>2024-04-05 21:23:06 +0100
commitb5b1c0137de5404dc771c48e83b0d5b00e4b052d (patch)
tree084d1250a78fd0428aa6e3aa4daff0972ef77d03 /src/helpers/Color.cpp
parent094bce811831675b03939e4a2d527998850c906d (diff)
CColor: fix getAsHex
Diffstat (limited to 'src/helpers/Color.cpp')
-rw-r--r--src/helpers/Color.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/helpers/Color.cpp b/src/helpers/Color.cpp
index 77e0d530..67526dc7 100644
--- a/src/helpers/Color.cpp
+++ b/src/helpers/Color.cpp
@@ -21,6 +21,6 @@ CColor::CColor(uint64_t hex) {
this->a = ALPHA(hex);
}
-uint64_t CColor::getAsHex() {
- return ((int)a) * 0x1000000 + ((int)r) * 0x10000 + ((int)g) * 0x100 + ((int)b) * 0x1;
+uint32_t CColor::getAsHex() {
+ return (uint32_t)(a * 255.f) * 0x1000000 + (uint32_t)(r * 255.f) * 0x10000 + (uint32_t)(g * 255.f) * 0x100 + (uint32_t)(b * 255.f) * 0x1;
} \ No newline at end of file