godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.14k stars 95 forks source link

Add API for HSL conversion #6794

Open bonjorno7 opened 1 year ago

bonjorno7 commented 1 year ago

Describe the project you are working on

I'm making a 3D color picker app where the position of points is determined by the color converted into HSV / HSL / etc.

Describe the problem or limitation you are having in your project

At the moment the only thing you can convert both to and from is HSV, so I'd like to add HSL.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

If the Color class had the necessary methods for converting to and from HSL, that would make my life easier.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

As per usual I've already implemented it: https://github.com/godotengine/godot/pull/76661

If this enhancement will not be used often, can it be worked around with a few lines of script?

Unlike with OK HSV / OK HSL, the math is fairly simple, and could be done in GDScript. It'd be faster and easier if it was just part of the Color class though.

Is there a reason why this should be core and not an add-on in the asset library?

HSV conversion is part of core, so it makes sense that HSL would be too.

aaronfranke commented 1 year ago

Reopening because the pull request was reverted.

If this functionality is added, it will be in a module, not in core.

bonjorno7 commented 1 year ago

Fair enough. It was a good learning experience at least.