Contact emails
Explainer
https://www.w3.org/TR/css-color-5/#colormix
Design docs/spec
Specification: https://www.w3.org/TR/css-color-5/#colormix
https://docs.google.com/document/d/1ZU_-8U11lhCfGsqEEe4ayaKHjkgOyexAMh2ZVqTW8vM
TAG review
Summary
color-mix takes two <color> specifications and returns the result of mixing them, in a given colorspace, by a specified amount. For example, `color-mix(red yellow 40%)` produces a mixture of 40% red and 60% yellow.
Motivation
This new function will give designers greater flexibility when working with colors. One example is to create tinted variants of a single base color to form a design palette.
We also need this function to support a CSSWG resolution related to background-color in forced colors mode. The resolution calls for using color-mix to construct the used background-color from the rgb channels of the appropriate system color plus the alpha channel from the computed color.
Risks
Interoperability and Compatibility
- The syntax for color-mix is still evolving based on CSSWG discussion. Mitigation: The motivation for prototyping this feature now is an internal use case. We can defer shipping until syntax has stabilized.
- Blink does not yet support all color spaces recognized by color-mix. Mitigation: We will reject color-mix declarations for unsupported color spaces so that authors can feature-detect using @supports.
Firefox: No public signals
Edge: No public signals
Safari: No public signals
Web developers: No signals
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes
Is this feature fully tested by web-platform-tests?
No Tests will be added as part of feature development.
Link to entry on the Chrome Platform Status
https://www.chromestatus.com/feature/5659115386830848
This intent message was generated by Chrome Platform Status.
- Blink does not yet support all color spaces recognized by color-mix. Mitigation: We will reject color-mix declarations for unsupported color spaces so that authors can feature-detect using @supports.
color:red; color:color-mix(/*unsupported color space*/);
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/baa004f1-bcd9-41a1-92a9-6ed42b7fdccbo%40chromium.org.
Contact emails
Explainer
https://www.w3.org/TR/css-color-5/#colormix
Design docs/spec
Specification: https://www.w3.org/TR/css-color-5/#colormix
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/BL0PR00MB0292EDD45074834660593AC2C0820%40BL0PR00MB0292.namprd00.prod.outlook.com.
- Re. forced colors mode: I think on its own it's not enough to fix the background adjustment magic called for in the spec. But agree that it _might_ be a path towards it. E.g. if we also invent a keyword that resolves to the computed value of background-color, then maybe.- If I understand correctly, this will require that we store color-mix functions on ComputedStyle, similarly to calc() for <length-percentage> properties. If that's true, then:
- I wonder if it makes sense to first make color keywords compute to themselves before attempting mix-color().
I think that currently follows from the fact that this function takes <color> values and some <color> values are not resolved until used value time.
Contact emails
Explainer
https://www.w3.org/TR/css-color-5/#colormix
Design docs/spec
Specification: https://www.w3.org/TR/css-color-5/#colormix
https://docs.google.com/document/d/1ZU_-8U11lhCfGsqEEe4ayaKHjkgOyexAMh2ZVqTW8vM
TAG review
Summary
color-mix takes two <color> specifications and returns the result of mixing them, in a given colorspace, by a specified amount. For example, `color-mix(red yellow 40%)` produces a mixture of 40% red and 60% yellow.
Motivation
This new function will give designers greater flexibility when working with colors. One example is to create tinted variants of a single base color to form a design palette.
We also need this function to support a CSSWG resolution related to background-color in forced colors mode. The resolution calls for using color-mix to construct the used background-color from the rgb channels of the appropriate system color plus the alpha channel from the computed color.
Risks
Interoperability and Compatibility
- The syntax for color-mix is still evolving based on CSSWG discussion. Mitigation: The motivation for prototyping this feature now is an internal use case. We can defer shipping until syntax has stabilized.
- Blink does not yet support all color spaces recognized by color-mix. Mitigation: We will reject color-mix declarations for unsupported color spaces so that authors can feature-detect using @supports.
Firefox: No public signals
Edge: No public signals
Safari: No public signals
Web developers: No signals
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes
Is this feature fully tested by web-platform-tests?
No Tests will be added as part of feature development.
Link to entry on the Chrome Platform Status
https://www.chromestatus.com/feature/5659115386830848
This intent message was generated by Chrome Platform Status.
--
- Blink does not yet support all color spaces recognized by color-mix. Mitigation: We will reject color-mix declarations for unsupported color spaces so that authors can feature-detect using @supports.
Web developers: No signals
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/cea8c599-1c6c-4115-90a7-880238b32f54o%40chromium.org.
TAG reviewTAG review? Or will this go through wide review elsewhere?
Is this feature fully tested by web-platform-tests?
No Tests will be added as part of feature development.
Why?
Co-editor of CSS Color 5 here. 👋First off, really exciting to see this intent to prototype! (as long as you folks realize that the syntax is extremely in flux and could be completely revamped, and are cool with that).
See some comments below.
On Tuesday, June 9, 2020 at 6:44:37 PM UTC-4, Kevin Babbitt wrote:
- Blink does not yet support all color spaces recognized by color-mix. Mitigation: We will reject color-mix declarations for unsupported color spaces so that authors can feature-detect using @supports.
Please note that color-mix() uses the LCH color space for interpolation by default. You cannot implement color-mix() per spec until you also implement at the very least, the LCH color space, unless you make the colorspace argument mandatory in your prototype (which will result in very clumsy syntax). This is done because interpolation in gamma corrected sRGB space produces terrible results (and that is the only colorspace Blink supports right now). It was a mistake in other parts of CSS, one that we do not wish to repeat. Linear RGB would have been ok, but then the intermediate values would not be expressible in CSS. Furthermore, LCH tends to maintain consistent chroma, which is desirable more often than not.
Web developers: No signals
I would argue that the very extensive use of similar functions in every CSS preprocessor is a pretty strong signal!
On Monday, June 15, 2020 at 6:15:27 AM UTC-7, Yoav Weiss wrote:
TAG reviewTAG review? Or will this go through wide review elsewhere?TAG review requested here: https://github.com/w3ctag/design-reviews/issues/526
Is this feature fully tested by web-platform-tests?
No Tests will be added as part of feature development.
Why?This was unclear, sorry - I do intend to add tests as part of feature development.There's a checkbox on chromestatus.com for "Is this feature fully tested by web-platform-tests?" which I left unchecked because no tests exist yet. I think the template generated a "No" because that box was unchecked.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/2e404246-5d69-468f-9e9b-3ee13a8b4f94o%40chromium.org.