diff options
| author | bonjorno7 <jorijndegraaf@gmail.com> | 2023-05-13 00:02:56 +0200 |
|---|---|---|
| committer | bonjorno7 <jorijndegraaf@gmail.com> | 2023-05-13 16:57:19 +0200 |
| commit | 283cac859c01550cfb6470157cdbf69f12c5f38b (patch) | |
| tree | 93e0b1126af99329699e168d48c32fce205a9210 /core/math | |
| parent | c64afeb01731c477813d959daee99a99612d8077 (diff) | |
| download | redot-engine-283cac859c01550cfb6470157cdbf69f12c5f38b.tar.gz | |
Make ok_color functions static
It needs to be a class to prevent build errors, but the functions can at least be static, so you don't have to instance the class.
Diffstat (limited to 'core/math')
| -rw-r--r-- | core/math/color.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/core/math/color.cpp b/core/math/color.cpp index 0d9325f236..d36306d968 100644 --- a/core/math/color.cpp +++ b/core/math/color.cpp @@ -247,8 +247,7 @@ void Color::set_ok_hsl(float p_h, float p_s, float p_l, float p_alpha) { hsl.h = p_h; hsl.s = p_s; hsl.l = p_l; - ok_color new_ok_color; - ok_color::RGB rgb = new_ok_color.okhsl_to_srgb(hsl); + ok_color::RGB rgb = ok_color::okhsl_to_srgb(hsl); Color c = Color(rgb.r, rgb.g, rgb.b, p_alpha).clamp(); r = c.r; g = c.g; @@ -595,8 +594,7 @@ float Color::get_ok_hsl_h() const { rgb.r = r; rgb.g = g; rgb.b = b; - ok_color new_ok_color; - ok_color::HSL ok_hsl = new_ok_color.srgb_to_okhsl(rgb); + ok_color::HSL ok_hsl = ok_color::srgb_to_okhsl(rgb); if (Math::is_nan(ok_hsl.h)) { return 0.0f; } @@ -608,8 +606,7 @@ float Color::get_ok_hsl_s() const { rgb.r = r; rgb.g = g; rgb.b = b; - ok_color new_ok_color; - ok_color::HSL ok_hsl = new_ok_color.srgb_to_okhsl(rgb); + ok_color::HSL ok_hsl = ok_color::srgb_to_okhsl(rgb); if (Math::is_nan(ok_hsl.s)) { return 0.0f; } @@ -621,8 +618,7 @@ float Color::get_ok_hsl_l() const { rgb.r = r; rgb.g = g; rgb.b = b; - ok_color new_ok_color; - ok_color::HSL ok_hsl = new_ok_color.srgb_to_okhsl(rgb); + ok_color::HSL ok_hsl = ok_color::srgb_to_okhsl(rgb); if (Math::is_nan(ok_hsl.l)) { return 0.0f; } |
