Consider support for interpolate expressions in Oklab color space
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
Motivation
I was recently investigating Oklab for a personal project (after seeing now the default for gradients in Photoshop: https://twitter.com/bjornornorn/status/1453069681082896394) and while I am not a color theorist, this article claims it has some perceptual improvements over CIELAB, especially in terms of blue hue. https://raphlinus.github.io/color/2021/01/18/oklab-critique.html
I wonder if what the effort is to support an interpolate-oklab expression to go with interpolate-lab, and if that effort is worth having more perceptually accurate color blending.
Design Alternatives
I am unaware of the complexity of adding interpolate-oklab, so we could just do nothing and have access to the CIELAB color space.
Design
https://docs.mapbox.com/mapbox-gl-js/style-spec/expressions/#interpolate-lab
We already have an interpolate-lab expression, so from my perspective copying that seems fine, but if there's any drawbacks to that design we should rethink for an interpolate-oklab expression I'd assume that's ok as well.
Mock-Up
["interpolate-oklab", ["linear"], ["get", "step"], 0, "red", 1, "blue"]
Concepts
Implementation
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing interpolate-lab expression and the linked style-spec expression documentation to identify the relevant parsing, evaluation, and test entry points. Compare the proposed interpolate-oklab syntax with interpolate-lab, investigate the color-conversion and edge-case requirements, and define completion as the expression working consistently across the Mapbox GL ecosystem with documentation and tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100