Skip to content

[css-color-5] lch/lab out of gamut mapping #6668

Closed
@surma

Description

@surma

(I tried to figure out if gamut mapping is prescribed anywhere, but couldn’t quite get clarity. Please let me know if I missed something in the specs here.)

Safari TP (I’m using TP 132) supports lab() and lch() but the gamut mapping they utilize is, in my opinion, unexpected. Specifically, any value with 0% lightness can end up being quite colorful if the remaining parameters are big enough. Mathematically, that makes sense: lch(0% 100 0) maps to rgb(37.59% -21.03% 3.46%). Safari now performs clamping to gamut map, using rgb(37.59% 0% 3.46%) as the rendering color.

Screen Shot 2021-09-22 at 16 44 40

Similar unexpected behavior can be triggered with lab().

I wonder if it would be appropriate, at least for color spaces that model “lightness” to be a bit more prescriptive on how gamut mapping should work, i.e. that L=0 can only result in black.

cc @argyleink

Metadata

Metadata

Assignees

Labels

Closed as Question AnsweredUsed when the issue is more of a question than a problem, and it's been answered.Commenter SatisfiedCommenter has indicated satisfaction with the resolution / edits.css-color-4Current Work

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions