-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Color: Expose OKHSL properties #82845
Conversation
You haven't exposed the See also: |
doc/classes/Color.xml
Outdated
@@ -505,6 +505,9 @@ | |||
<member name="v" type="float" setter="" getter="" default="0.0"> | |||
The HSV value (brightness) of this color, on the range 0 to 1. | |||
</member> | |||
<member name="ok_hsl_l" type="double" setter="" getter="" default="0.0"> |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Ok with the proposal but the cicd has to pass and colours are 32 bit floats. |
This comment was marked as off-topic.
This comment was marked as off-topic.
What use would it be to only have the l value and not the h or s values? |
I have now added all the values for |
Can this sneak into the 4.2 release @lostminds? |
@Hysterelius I have no say or insight regarding that, I'm just a member of the community. Merging of pull requests and which branch they will go into is decided on by the various Godot core contributor teams. You can see below that this particular one will need review and approval by the core and documentation teams. |
Sorry, I just assumed you would have to finish your review before the other teams could look at it. |
4.2 is in feature freeze so will likely have to wait for 4.3, this PR was opened just around the time of feature freeze |
@AThousandShips is this really a feature though? feels more like a fix for forgetting to expose the already existing feature in a non-writeonly manner... |
That falls under features, it's not a bug but missing functionality, in either case we are close to release so it can soon be looked into once the 4.3 cycle starts |
This comment was marked as off-topic.
This comment was marked as off-topic.
@Kermalis Please don't bump without contributing significant new information. Use the 👍 reaction button on the first post instead. |
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.
I needed a way to reduce the lightness of an existing red colour.
The theory is I'd from a red colour I'd get the existing okhsl values from this enhancement, then use to half the lightness value. from_ok_hsl(h: float, s: float, l: float, alpha: float = 1.0)
Sorry for the delay!
Please squash your commits into one, see the interactive rebase |
Amended the commit message to be clearer, and tweaked the spelling of OKHSL (it was "OkHSL" in the docs). |
Thanks! |
I’m proposing a solution to enhance the
Color
class by adding anOkHSL
lightness attribute. This attribute will facilitate the creation of colour palettes based on predefined colour stops. Currently, this PR exposes a previously private function to public gdscript. I’m unsure how to extend this functionality to C#, and would appreciate any help on this matter.This PR is an implementation of my feature proposal, just aiming to expose pre-existing infrastructure to the user.
I’ve tested these changes locally and everything appears to be working correctly, but I welcome any feedback or suggestions on my PR’s implementation.
Production edit: Closes godotengine/godot-proposals#7954