Re: [csswg-drafts] [css-color-4] L as `<percentage>` in `lab()` and `oklab()` (#6761)

> So I have to remember that CSS treats CIE Lightness as a percentage, and that percentages in CIE Lightness map to 0-100 in CSS so okay I slap on a percent sign; but I just use the numbers as-is
> [...]
> Now I want to use the OK values so I remember that in CSS (as currently specified) I have to slap on a percent and also multiply by 100

I think you're vastly overcomplicating the mental model people will be using here! I suspect the overwhelming majority of authors will just go "0% lightness is black, 100% lightness is white, values between are colors of varying lightness levels", *because that's how lightness already works in HSL*, which is the color function closest to Lab/etc that's been in use for decades (and it accords with how percentages work everywhere else in CSS and generally in non-CSS contexts too).

You appear to be asserting that it's simpler for authors to remember "in HSL lightness is 0%-100%, in Lab/LCH lightness is 0-100, in oklab/oklch lightness is 0-1", despite all three assigning identical meanings to the endpoints? Like, I get it that if you're copying colors straight from some other application it would be *nice* to just be able to paste them into the parentheses unchanged, but to assert that this is a *simpler mental model* seems frankly untenable to me.

(I think it's *weird* that Lab used a rough 0-100 range for the past 50 years while OKLab, intended as a successor which is *more or less indistinguishable in most cases*, chose to instead scale its numbers to a rough 0-1 range, but hey, I didn't design it. I guess it's just an annoying quirk authors will have to learn.)

> and then I do the OKLCH an, um, does Chroma get multiplied by 100 too? Does it get a percent? If so, that is a percent of what?

I mean, it's not *unreasonable* for people to assume that chroma, like HSL's saturation, is written as a percentage, but in practice it doesn't have a useful max value as a range. Unfortunate, but that's how it is. It's just an oddity of colors that authors will have to learn; it's a syntax error if they screw it up so at least it's immediately obvious a mistake has been made, and it'll show up as an error in devtools.

But yeah, it's already gonna be confusing that lch()'s chroma maxes out in the vicinity of 100 while oklch()'s chroma maxes out in the vicinity of 1.

I don't see how the rest of your questions are even remotely believable as an author's thought pattern, so I won't address them.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6761#issuecomment-952402590 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 26 October 2021 23:19:26 UTC