mapbox / mapbox/mapbox-gl-js

Consider support for interpolate expressions in Oklab color space

Open
#11,348 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

cross-platform :tv: feature :green_apple:
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.