-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow picking similar colours using OKHSL. #59786
Conversation
I wonder if it wouldn't be better if an |
I was planning to refactor the ColorPicker, because the color modes are awfully hard-coded right now; I might do it eventually™. Somewhat related issue: #31679 |
@YeldhamDev if you can send a commit, I can integrate it. |
I think if we add OKHSL to the colour picker, we should also be adding it to the GradientTexture2D. To me, the real benefit of OKLab is interpolating colours in perceptually uniform space. I think users will be disappointed if they are selecting colours in OKLab, but the colours are interpolated in RGB or HSL. |
Or it could be added to Gradient, so that everywhere that Gradients are used benefits from it (GradientTexture2D/1D, particles, FastNoiseLite, etc.) |
Yes, that makes much more sense. |
598a54c
to
f55a4a0
Compare
Can you guys assist adding to a Gradient after the pr is merged? |
If we are adding OKLab, I think it should be added to gradient at the same time it is added to the color picker. I don't see the value in just exposing it to the color picker. But, of course, let me know if I am wrong. |
c917e10
to
72b529e
Compare
@fire The Gradient changes look good, I haven't tested them yet but I will soon. Also, I noticed that the OKHSL-related Color functions don't seem to be exposed, so maybe you could do that? It could be useful to have access to them in GDScript. |
3174cb9
to
6ebef66
Compare
@clayjohn I don't think it's really possible to interpolate all three variables: the hue, the lightness and the saturation. We have to keep one constant and a small change in hues is a big change in HSL space. Interpolating in RGB and then using okhsl lightness and okhsl saturation didn't give good results. |
I'll merge the kobewi change properly. |
btw you have me added as a co-author of the commit (probably from applying suggestion on GitHub). |
4cef4fd
to
1dfa119
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me overall. Would be nice if @Vitika9 could review too as that will impact her GSoC project.
Looks good from my project's point of view too :) |
Thanks! |
Fixes: godotengine/godot-proposals#4325
Pain points requested for help:
get_ok_hsl_h
naming in Color2022-04-01.05-11-46.mp4
HSL Game Project.zip test project.