summaryrefslogtreecommitdiffstats
path: root/core/color.cpp
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2020-11-03 00:21:06 +0100
committerAaron Franke <arnfranke@yahoo.com>2020-11-03 04:46:08 -0500
commit7adb6b91b33e297b4833ef5f82adcf64a15777f4 (patch)
tree8a47d75e5a7ea66f1b5deec162408887090cdd11 /core/color.cpp
parent873d4617852cddfd368e3046f718f410eade6a3e (diff)
downloadredot-engine-7adb6b91b33e297b4833ef5f82adcf64a15777f4.tar.gz
Remove `Color.contrasted()` as its behavior is barely useful
Returning the most contrasting color isn't a trivial task, as there are often many possible choices. It's usually best left for the user to implement using a script.
Diffstat (limited to 'core/color.cpp')
-rw-r--r--core/color.cpp12
1 files changed, 0 insertions, 12 deletions
diff --git a/core/color.cpp b/core/color.cpp
index c61ee0e64a..4047ca5037 100644
--- a/core/color.cpp
+++ b/core/color.cpp
@@ -217,12 +217,6 @@ void Color::invert() {
b = 1.0 - b;
}
-void Color::contrast() {
- r = Math::fmod(r + 0.5, 1.0);
- g = Math::fmod(g + 0.5, 1.0);
- b = Math::fmod(b + 0.5, 1.0);
-}
-
Color Color::hex(uint32_t p_hex) {
float a = (p_hex & 0xFF) / 255.0;
p_hex >>= 8;
@@ -284,12 +278,6 @@ Color Color::inverted() const {
return c;
}
-Color Color::contrasted() const {
- Color c = *this;
- c.contrast();
- return c;
-}
-
Color Color::html(const String &p_rgba) {
String color = p_rgba;
if (color.length() == 0) {