Re: [csswg-drafts] [mediaqueries] In-gamut media query (#5045)

@leaverou wrote:

> already allow providing a fallback in color() if the specified color is _out of gamut_

@faceless2 i
> if the original color is _invalid_ 

Aha, both reasonable interpretations of wooly prose:

> The color function takes one or more comma-separated arguments, with each argument specifying a color, and later colors acting as "fallback" if an earlier color **can’t be displayed** (for example, if the colorspace it specifies hasn’t been loaded yet).

`can't be displayed` is undefined except for an illustrative, parenthetical example.

To test a single color to be in-gamut, for additive colorspaces, you just need to check if any component is negative, or greater than 1.0 /  100%. (While using a code path that does not prematurely clip, obviously).

For non-additive colorspaces, like print, you also need to check that TAC is not exceeded.

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

Received on Tuesday, 5 May 2020 18:00:43 UTC