diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-11-06 10:17:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-06 10:17:12 +0100 |
commit | 52c1b5fc411a6e9760c97d17835952dda1d4bd4b (patch) | |
tree | 3d2180c87ead03fcf50036d85518cafeb58f1fb2 /core | |
parent | d79e57882b333b0e5ca47579cfe7bf3188bee274 (diff) | |
parent | 7adb6b91b33e297b4833ef5f82adcf64a15777f4 (diff) |
Merge pull request #43283 from Calinou/color-remove-contrasted
Remove `Color.contrasted()` as its behavior is barely useful
Diffstat (limited to 'core')
-rw-r--r-- | core/color.cpp | 12 | ||||
-rw-r--r-- | core/color.h | 2 | ||||
-rw-r--r-- | core/variant_call.cpp | 1 |
3 files changed, 0 insertions, 15 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) { diff --git a/core/color.h b/core/color.h index 2dbbc52905..8980efe74a 100644 --- a/core/color.h +++ b/core/color.h @@ -91,9 +91,7 @@ struct Color { bool is_equal_approx(const Color &p_color) const; void invert(); - void contrast(); Color inverted() const; - Color contrasted() const; _FORCE_INLINE_ Color lerp(const Color &p_b, float p_t) const { Color res = *this; diff --git a/core/variant_call.cpp b/core/variant_call.cpp index b1a046a72c..d2b626a942 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -1614,7 +1614,6 @@ void register_variant_methods() { bind_method(Color, to_rgba64, sarray(), varray()); bind_method(Color, inverted, sarray(), varray()); - bind_method(Color, contrasted, sarray(), varray()); bind_method(Color, lerp, sarray("b", "t"), varray()); bind_method(Color, lightened, sarray("amount"), varray()); bind_method(Color, darkened, sarray("amount"), varray()); |