summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-08-31 11:47:18 +0200
committerGitHub <noreply@github.com>2017-08-31 11:47:18 +0200
commitf00760b22cee9cb1472dd7f02820556d273d7919 (patch)
tree65153e657738dc96809913b790ec00630c7f4476 /core
parentf1e3dec4422a114d42ebb29daefa8c3d4bf83999 (diff)
parentff0a149de94b723a6013fb224ec5a8d0bfada68d (diff)
Merge pull request #10382 from toger5/dark_icons
Light Theme
Diffstat (limited to 'core')
-rw-r--r--core/color.cpp12
-rw-r--r--core/color.h4
2 files changed, 14 insertions, 2 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);
diff --git a/core/color.h b/core/color.h
index 6df114f2f2..cd5510cf01 100644
--- a/core/color.h
+++ b/core/color.h
@@ -53,6 +53,7 @@ struct Color {
uint32_t to_32() const;
uint32_t to_ARGB32() const;
+ uint32_t to_ABGR32() const;
float gray() const;
float get_h() const;
float get_s() const;
@@ -148,8 +149,7 @@ struct Color {
b < 0.0031308 ? 12.92 * b : (1.0 + 0.055) * Math::pow(b, 1.0f / 2.4f) - 0.055, a);
}
- static Color
- hex(uint32_t p_hex);
+ static Color hex(uint32_t p_hex);
static Color html(const String &p_color);
static bool html_is_valid(const String &p_color);
static Color named(const String &p_name);