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

Summing up this thread, there seems to have been some confusion between two very different options

1. One color to keep, list of colors, optional target. _Pick_ the first color _from the list_ that hits the target. If no target given, pick the color with highest contrast.
2. One color to keep, one color to modify, {target and other metadata like boldness, font size etc}. Modify the color in some way so it meets the criteria.

The first of these is the topic of the issue. It is a small adjustment to the [existing `color-contrast() function`](https://drafts.csswg.org/css-color-5/#colorcontrast). I see @argyleink and @mirisuzanne in favor of this option.

The second is interesting, but is a totally new function and would need a concrete proposal. WCAG 2.1 contrast is also being radically changed in WCAG 3.

There has also been some great discussion about the color modification aspect of the second option, parts of which could also influence further development of [`color-adjust()`](https://drafts.csswg.org/css-color-5/#coloradjust), [gradients](https://drafts.csswg.org/css-images-4/#gradients), [transitions](https://drafts.csswg.org/css-transitions/#transitions) and [animations](https://drafts.csswg.org/css-animations-2/#animations):

- selecting a better colorspace or color appearance model in which to do color interpolation, modification, creation. CAM02 has been mentioned (which has better hue uniformity, but is also more complex and has some troubling numerical stability and invertibility issues). CAM16-UCS would probably be an even better option there; OKLCH, Jzazbz, or ICtCp are other options.
- constructing multi-stop gradients by using a cubic bezier rather than piecewise linear segments. This avoids the slope discontinuities that are inherent to piecewise linear. Easing functions, and Catmul-Rom functions, are other options which produce smooth curves with the added benefit that off-curve control points do not need to be specified, and the curve passes _through_ (rather than _near to_) all of the stops.
- taking into account font size, font-weight, and other factors when calculating acceptable minimum contrast

As @LeaVerou just observed when we were discussing this issue, I wish there was a way to fork (parts of) an issue into a new issue).

Getting back to option one though, @mirisuzanne I see your Agenda+ was this to suggest adopting the proposal? As there are no objections to it in this issue, I think we can just do it.

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


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

Received on Wednesday, 31 March 2021 17:16:11 UTC