v3.0.0 #192
danburzo
announced in
Announcements
v3.0.0
#192
Replies: 2 comments 3 replies
-
This is great! Will there be a feature for explicitly accessing a single channel from a color object similar to Chroma.js |
Beta Was this translation helpful? Give feedback.
3 replies
-
thanks so much for your relentless work! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Breaking changes
This new release includes revamped color parsing to align with the latest
css-color-4
spec. Regular expression matching has been replaced with a parser that follows thecss-syntax
spec more closely.The new parser is more flexible with some aspects and stricter with others:
rgb(1-.2.3)
, are now properly handled (Exoticrgb()
syntaxes trip up culori.js #187)<number>
,<percentage>
and'none'
component valuescolor()
syntax no longer supports omitted component values that default to0
; it now requires exactly three component values. (color()
syntax: don't allow omitted components #186)Interpretation of component values has been aligned to the spec:
lch.c
(Chroma in the CIELCh color space) is[0, 150]
, with100%
corresponding to150
.Serialization has also been aligned to the spec:
lab
andlch
serialize theL
component as<number>
, not<percentage>
oklab
,oklch
andlrgb
are serialized tooklab()
,oklch()
, andcolor(srgb-linear)
respectively.Please consult the migration guide for assistance in upgrading from 2.x to 3.0.
API changes
parseRgb
andparseHsl
now perform parsing of the modern syntax forrgb()
andhsl()
respectively;parseRgbLegacy
andparseHslLegacy
have been added to parse the legacy syntaxes forrgb()
/rgba()
/hsl()
/hsla()
parseOklab
andparseOklch
have been added to parseoklab()
andoklch()
.This discussion was created from the release v3.0.0.
Beta Was this translation helpful? Give feedback.
All reactions