Skip to content

Conversation

@mbostock
Copy link
Member

@mbostock mbostock commented Apr 16, 2023

Ref. https://www.w3.org/TR/css-color-5/

Allows a variety of new ways of specifying colors, including mixing colors:

color-mix(in lch, purple 50%, plum 50%)

And relative colors:

lch(from currentColor calc(1 - l) c h)

Though, I can’t really seem to get the latter to work, so probably we should leave this as a draft until it works.

Fixes #1851.

@mbostock mbostock requested a review from Fil April 16, 2023 16:48
@Fil
Copy link
Contributor

Fil commented Apr 17, 2023

I'm fine with merging this earlier than it works in browsers, since we're just "passing colors through". When it works, your second example will be very useful for dark mode (just stating the obvious).

color-mix is still waiting for firefox, it seems. (For lch() I couldn't find the additional syntax on caniuse.)

@mbostock
Copy link
Member Author

This looks ready — it just needs test. The lack of browser support for level 5 shouldn’t be a blocker because this is also adding support for level 4.

@mbostock mbostock marked this pull request as ready for review September 13, 2023 16:44
@mbostock mbostock enabled auto-merge (squash) September 13, 2023 16:58
@mbostock mbostock merged commit cce2ff5 into main Sep 13, 2023
Copy link
Contributor

@Fil Fil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p3 colors yay!!

@mbostock mbostock deleted the mbostock/more-color branch September 13, 2023 17:11
chaichontat pushed a commit to chaichontat/plot that referenced this pull request Jan 14, 2024
* allow CSS Color Module Level 5

* add tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

allow native color functions with CSS vars as colors

3 participants