Re: [csswg-drafts] [css-color-5] add target contrast ratio to color-contrast? (#4749)

Hi @NateBaldwinDesign thanks for the helpful commentary and also the link to leonardocolor which we (the editors) have been playing with of late.

In terms of what the proposed `color-contrast()` does, if the current specification gives the impression that the function replaces careful design and user testing, we would certainly want to reword to avoid suggesting that conclusion. It is just a utility function; intended to give some help to stylesheet authors beyond the current situation, which is to not consider contrast at all. For a static color scheme, of course,  contrast can be evaluated with human subjects or a site analysis tool. As we move into more dynamic, thematic-based color schemes, such testing becomes more complex and lengthy, so we felt that giving CSS itself the ability to perform some of that testing would be helpful.

It's interesting that you mention the CIECAM color appearance models, and it is reasonable to ask why CSS Color 4 and 5 are defined in terms of colorimetry (Lab and LCH) instead of color appearance. The reason that color appearance (which was considered) could not be used in CSS is because of the inherent nature of CSS. Style rules from various origins (author, reader, user agent) are combined via specificity and cascading to yield an eventual result. Thus, all colors are specified at a very granular level on individual elements in the document tree. There is thus no notion of the overall visual field or surroundings in which colors will take on an appearance. Certain aspects of that (the background color or image for a specific element, the colors of nearby elements) could in theory be tractable to analysis by a CSS processor. Others (the colors of other windows that are visible in addition to the browser window) are not available (and _must_ not be, for security and privacy reasons); the overall room luminance, the current white point and the degree of user adaptation to that white point are unknown to a CSS processor and thus cannot be used as input to a color appearance model.

I had already noticed that your leonardocolor tool offers CIECAM02 as an option, but I was unable to find how to indicate any of the required parameters (such as adapting  field  luminance,  chromatic induction factor, lightness contrast factor or the factor for the degree of adaptation) once it was selected. How do you account for these in your tool?

Your point about better-than-linear interpolations and the need for easing or smoothing functions is well made.

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

Received on Thursday, 23 April 2020 04:04:29 UTC