Editor: Add an OKLab colour picker #1816
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
OkLab Colour Picker
I extended the colour picker in the level editor so that colours can be chosen in the perceptual OkLab colourspace (actually L, C, h and not L, a, b). The user can change the lightness, chroma or hue with the mouse or keyboard. The colour is gamut clipped to fit in sRGB.
Here's a video of the colour picker:
oklab_colour_picker.mp4
To Do
Additional information
Hue Selection Gamut Clipping
I tried different gamut clipping methods for the hue selection:
The pictures correspond to following methods:
Links
OkLab description: https://bottosson.github.io/posts/oklab/
Gamut clipping: https://bottosson.github.io/posts/gamutclipping/
I copied MIT-licensed code from there.