maplibre / maplibre-style-spec

MapLibre Style Specification & Utilities
https://maplibre.org/maplibre-style-spec/
Other
79 stars 64 forks source link

Design proposal: P3 color space & OKLCH/OKLAB color support #852

Open russss opened 6 days ago

russss commented 6 days ago

The P3 color space is a replacement for sRGB which supports a wider range of colors. It is now relatively widely supported by web browsers and modern display hardware. It appears to be supported by WebGL. I would like to make maps using the secret new colors.

OKLCH is a new color format (i.e. an alternative to RGB/HSL/LAB) which supports addressing all the colors in the P3 color space (and more). It also provides better, more perceptually uniform lightness and hue transitions than the older alternatives, which would make choropleth/heatmaps look nicer. It is widely supported in web browsers in CSS4.

I think Maplibre should add support for the P3 color space and the OKLCH color format (which would involve adding an oklch() function and an interpolate-oklch expression to the style language).

Further reading

HarelM commented 6 days ago

I moved this issue here, to be discussed as part of style spec changes. Note that in the past we introduced some CSS4 color support: https://github.com/maplibre/maplibre-style-spec/pull/175 This sounds a bit more complicated, but I don't see a reason not to introduce this.