-
Notifications
You must be signed in to change notification settings - Fork 35
Releases: Evercoder/culori
v3.0.0
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 the css-syntax spec more closely.
The new parser is more flexible with some aspects and stricter with others:
- Trickier whitespace formulas around numbers, such as
rgb(1-.2.3), are now properly handled (#187) - All non-legacy syntaxes allow mixing
<number>,<percentage>and'none'component values - The
color()syntax no longer supports omitted component values that default to0; it now requires exactly three component values. (#186)
Interpretation of component values has been aligned to the spec:
- in non-legacy syntaxes, percentages are mapped to a reference range for that component. For example, the range of
lch.c(Chroma in the CIELCh color space) is[0, 150], with100%corresponding to150.
Serialization has also been aligned to the spec:
labandlchserialize theLcomponent as<number>, not<percentage>oklab,oklchandlrgbare serialized tooklab(),oklch(), andcolor(srgb-linear)respectively.
Please consult the migration guide for assistance in upgrading from 2.x to 3.0.
API changes
parseRgbandparseHslnow perform parsing of the modern syntax forrgb()andhsl()respectively;parseRgbLegacyandparseHslLegacyhave been added to parse the legacy syntaxes forrgb()/rgba()/hsl()/hsla()parseOklabandparseOklchhave been added to parseoklab()andoklch().
Assets 2
v2.1.1
Bug fixes
Fixes an inaccuracy in the original release of the XYB color space. The default color space used in JPEG XL contains an additional adjustment called Chroma from luma, that effectively subtracts Y from B
as the last step for an xyb color.
Assets 2
v2.1.0
New features
Adds support for the XYB (xyb) color model, part of the JPEG XL Image Coding System, as an LMS-based colour model inspired by the human visual system, facilitating perceptually uniform quantization. It uses a gamma of 3 for computationally efficient decoding
.
New exports: xyb (shortcut to converter('xyb')), modeXyb, convertXybToRgb, convertRgbToXyb.
Note: Please update to version 2.1.1 for an adjusted XYB color space that includes the Chroma from luma adjustment used in JPEG XL.
Above: The sRGB gamut in the XYB color space, for a slice of constant y.
Assets 2
v2.0.4
Fixes
- Adjusts the number precision in Oklab conversion matrices.
- Fixes sRGB <-> YIQ conversion to use gamma-corrected RGB values instead of linear values (#185, thanks @facelessuser)
Assets 2
v2.0.2
Adds package.json to the package exports to improve compatibility with some build tooling.
Assets 2
v2.0.1
Starting with this version, Culori is available to Deno users on deno.land/x/culori (thanks @nnmrts!). There are no code-related changes.
Assets 2
v2.0.0
⚠️ Breaking changes
➸ Please consult the Migration guide to upgrade from version
1.xto2.0.
xyzmode renamed toxyz50, along with all functions referencing it (e.g.convertLabToXyzbecomesconvertLabToXyz50) (#152).mode: 'xyz'is no longer supported.<number>for L no longer valid inlab()andlch()(#151)
New features
- All color components in all CSS color syntaxes now accept the
nonekeyword, in line with the latest changes in the CSS Color 4 spec. (w3c/csswg-drafts#6107) - Allow any number of components in the
color()CSS syntax, and fill in omitted components with0.
Assets 2
v1.2.0
New features
New color spaces: Added support for Björn Ottosson's Okhsl and Okhsv color spaces, two new color spaces for color picking. They are available as the okhsl and okhsv modes.
Tree shaking: Added exports for low-level parsing/conversion/serialization functions, co you can use Culori without pre-registering any color space. See the Tree shaking guide for details, and the Low-level API section of the API reference for available functions.
Assets 2
v1.1.1
New features
Use the culori/css or culori/all bootstrap packages in addition to culori/fn to quickly bootstrap CSS-supported color spaces / all color spaces while maintaining tree-shakeability:
import 'culori/css'; import { interpolate } from 'culori/fn';
Assets 2
v1.1.0
Incomplete release. See version v1.1.1 above.