summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-02-12 12:54:24 +0100
committerGitHub <noreply@github.com>2020-02-12 12:54:24 +0100
commit70dd7f4e1ae890534692067797c42337c45d3daf (patch)
tree3f73da9fa13c9801f97feb36d784f9ecc064dc00 /core
parent0c7fc80cc19fe9cd609b145245b1bb70f6a41e2e (diff)
parent7bc1dc828f1636cdc9dc253d28a279f18c9c72c8 (diff)
Merge pull request #32293 from hbina/remove_color_gray
Removed Color::gray
Diffstat (limited to 'core')
-rw-r--r--core/color.cpp7
-rw-r--r--core/color.h1
-rw-r--r--core/image.cpp2
-rw-r--r--core/variant_call.cpp2
4 files changed, 1 insertions, 11 deletions
diff --git a/core/color.cpp b/core/color.cpp
index cb3068c487..03aeb2085b 100644
--- a/core/color.cpp
+++ b/core/color.cpp
@@ -508,13 +508,6 @@ Color Color::from_hsv(float p_h, float p_s, float p_v, float p_a) const {
return Color(m + r, m + g, m + b, p_a);
}
-// FIXME: Remove once Godot 3.1 has been released
-float Color::gray() const {
-
- WARN_DEPRECATED_MSG("'Color.gray()' is deprecated and will be removed in a future version. Use 'Color.v' for a better grayscale approximation.");
- return (r + g + b) / 3.0;
-}
-
Color::operator String() const {
return rtos(r) + ", " + rtos(g) + ", " + rtos(b) + ", " + rtos(a);
diff --git a/core/color.h b/core/color.h
index 75a2b07d71..a7ab94ab08 100644
--- a/core/color.h
+++ b/core/color.h
@@ -56,7 +56,6 @@ struct Color {
uint64_t to_rgba64() const;
uint64_t to_argb64() const;
uint64_t to_abgr64() const;
- float gray() const;
float get_h() const;
float get_s() const;
float get_v() const;
diff --git a/core/image.cpp b/core/image.cpp
index b126437fa9..d9f84621a3 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -1715,7 +1715,7 @@ Error Image::generate_mipmap_roughness(RoughnessChannel p_roughness_channel, con
roughness = c.b;
} break;
case ROUGHNESS_CHANNEL_L: {
- roughness = c.gray();
+ roughness = c.get_v();
} break;
case ROUGHNESS_CHANNEL_A: {
roughness = c.a;
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index 6b5b947185..f088705cdd 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -488,7 +488,6 @@ struct _VariantCall {
VCALL_LOCALMEM0R(Color, to_argb64);
VCALL_LOCALMEM0R(Color, to_abgr64);
VCALL_LOCALMEM0R(Color, to_rgba64);
- VCALL_LOCALMEM0R(Color, gray);
VCALL_LOCALMEM0R(Color, inverted);
VCALL_LOCALMEM0R(Color, contrasted);
VCALL_LOCALMEM2R(Color, linear_interpolate);
@@ -1737,7 +1736,6 @@ void register_variant_methods() {
ADDFUNC0R(COLOR, INT, Color, to_argb64, varray());
ADDFUNC0R(COLOR, INT, Color, to_abgr64, varray());
ADDFUNC0R(COLOR, INT, Color, to_rgba64, varray());
- ADDFUNC0R(COLOR, REAL, Color, gray, varray());
ADDFUNC0R(COLOR, COLOR, Color, inverted, varray());
ADDFUNC0R(COLOR, COLOR, Color, contrasted, varray());
ADDFUNC2R(COLOR, COLOR, Color, linear_interpolate, COLOR, "b", REAL, "t", varray());