W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2020

Re: [csswg-drafts] [css-color-5] Findings on SCSS function usage to inform direction of Color 5 (#5782)

From: Una Kravets via GitHub <sysbot+gh@w3.org>
Date: Wed, 16 Dec 2020 17:14:03 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-746659355-1608138842-sysbot+gh@w3.org>
> Do we agree to ditch both color-adjust() and the relative function syntax, and instead add functions for component extraction?

I still like color-adjust because it enables more room to grow in the future.

I've felt that we should implement these with existing popular web color spaces today if the input colors are within those color spaces. I.e. if the input is RGB or HSL, we should still be able to make adjustments. This would make implementation in a timely manner much more likely, and also can still work with planning for future color spaces (the optional attribute to set which color space the mixing occurs in, or if any of the input arguments are in that color space).

Allowing for transformations in HSL or RGB color spaces would mean that developers could use these today (something they are clearly asking for, as evidenced above), and browsers could implement them without the additional performance hit (and pre-requisite) of supporting a more advanced color format.

Also, would we be able to adjust multiple components at a time? 

> How many functions do we add for component extraction? It looks like the no brainers are alpha(), hue(), lightness(), chroma(), saturation(). Perhaps also whiteness() and blackness()?

Same question above -- I want to avoid creating new custom properties for each transformation if we wanted to adjust both saturation and lightness of a single theme variable. (This would be a common example of translating a theme color for dark themes)

> Do we also add red(), green(), blue()? They are used in SCSS (about 1% of pages each). If we do add them, can they extract components from RGB color spaces defined via color(), e.g. display-p3?

Regardless of usage, they would enable a more complete system, so I do think we should add them. RGB channels are often tweaked in SVG filters to create unique effects.

> Do we need functions for Lab? If so, what to name them? I'd rather avoid single letter functions, but lab-a() is inconsistent with say hue().

If we go down this route, yes.

> What to do with color() components?

I think we'll still need `color()` for serialization, but I don't think it conflicts with this.

> Can browsers optimize something like lch(300 chroma(var(--mycolor)) lightness(var(--mycolor))) to avoid converting var(--mycolor) to LCH twice?

I agree we need a solution for multiple transforms at the same time

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 16 December 2020 17:14:09 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:37 UTC