summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-08-03 16:06:53 +0200
committerGitHub <noreply@github.com>2022-08-03 16:06:53 +0200
commit3ea9a7daea58c825a78ce1b5ed5d2becc2f84966 (patch)
tree2286d84173f86cfa095689985835a9b2b43775e5 /scene
parente38118c96069665259fb56729f75885bce9b13df (diff)
parent8b64e331c3b83b9d8995bc9a0d3264c47e3de3b5 (diff)
Merge pull request #63791 from V-Sekai/mend-ok-hsl-washout
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/color_picker.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index 788feacdd9..8f63d76347 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -171,6 +171,9 @@ uniform float v = 1.0;
void fragment() {
float x = UV.x - 0.5;
float y = UV.y - 0.5;
+ float h = atan(y, x) / (2.0 * M_PI);
+ float s = sqrt(x * x + y * y) * 2.0;
+ vec3 col = okhsl_to_srgb(vec3(h, s, v));
x += 0.001;
y += 0.001;
float b = float(sqrt(x * x + y * y) < 0.5);
@@ -180,9 +183,6 @@ void fragment() {
float b3 = float(sqrt(x * x + y * y) < 0.5);
x += 0.002;
float b4 = float(sqrt(x * x + y * y) < 0.5);
- float s = sqrt(x * x + y * y);
- float h = atan(y, x) / (2.0*M_PI);
- vec3 col = okhsl_to_srgb(vec3(h, s, v));
COLOR = vec4(col, (b + b2 + b3 + b4) / 4.00);
})");
}