Bot releases are hidden (Show)
Published by facelessuser over 2 years ago
closest
method that takes a list of colors and returns the one that is closet to the calling colorcolor()
. This means that when a channel othercoloraide.spaces.WHITES
is now a 2 deep dictionary containing both 2˚ and 10˚ observer variants of whiteWHITE
as a tuple with the x and y chromaticity coordinates. This allows alonger
hue interpolation when θ1 - θ2 = 0
. The spec is wrong in this case, and interpolation shouldrgb()
, rgba()
, hsl()
, and hsla()
comma separated forms in CSS do not support none
, only thepy.typed
is installed with package so that type annotations work properly.Published by facelessuser over 2 years ago
Published by facelessuser over 2 years ago
Warning: Breaking Changes
Prior to 0.11.0, if you specified a cylindrical space directly, ColorAide would normalize undefined hues the same
way that the conversion algorithm did. In the below case, saturation is zero, so the hue was declared undefined.>>> Color('hsl(270 0% 50%)') color(--hsl none 0 0.5 / 1)
We should not have been doing this, and it made some cases of interpolation a bit confusing. It is no longer
done as the hues are in fact specified by the user, even if they are powerless in relation to contributing to
the rendered color. When a cylindrical color is converted or if a user declares the channel as undefined with
none
or some other way, then the channel will be declared undefined, because in these cases, they truly are.>>> Color('white').convert('hsl') color(--hsl none 0 1 / 1) >>> Color('color(--hsl none 0 0.5)') color(--hsl none 0 0.5)
If you are working directly in a cylindrical color space and ever wish to force the normalization of color hues
as undefined when the color meets the usual requirements as specified by the color space's current rules, just
callnormalize
on the color and it will apply the same logic that occurs during the conversion process.>>> Color('hsl(270 0% 50%)').normalize() color(--hsl none 0 0.5 / 1)
If you relied on commas in CSS forms that did not support them, this behavior is no longer allowed. It was
thought that CSS may consider allowing comma formats in formats likehwb()
, etc., and it was considered, but
ultimately the decision was to avoid adding such support. We've updated our input and output support to reflect
this. Color spaces can always be subclassed and have this support added back, if desired, but will not be shipped
as the default anymore.The D65 form of Luv and LCHuv is now the only supported Luv based color spaces by default now. D50 Luv and LCHuv
have been dropped andluv
andlchuv
now refers to the D65 version. In most places, the D65 is the most common
used white space as most monitors are calibrated for this white point. The only reason CIELAB and CIELCH are D50
by default is that CSS requires it. Anyone interested in using Luv with a different white point can easily
subclass the current Luv and create a new plugin color space that uses the new white point.Renamed DIN99o Lch identifier to the short name of
lch99o
.>
luv
and lchuv
will refer to the D65 version of the respective color spaces. D50din99o-lch
to lch99o
. To use in CSS color()
form, use--lch99o
.hwb()
, lab()
, lch()
, oklab()
, and oklch()
no longernone
, then it will be considered undefined, or ifPublished by facelessuser over 2 years ago
lch-chroma
). There are still some edge cases that makeoklch-chroma
less desirable.Published by facelessuser over 2 years ago
Warning: Breaking Change
Custom gamut mapping plugins no longer return coordinates and require the method to update the passed in color.
max_delta_e
via the new delta_e
argument. If the delta_e
parameter is omitted, the color object's default ∆Esrgb
, display-p3
, etc.) all support extended ranges, butsrgb
(including spaces such as okhsl
and okhsv
) do not support extendedPublished by facelessuser almost 3 years ago
Warning: Breaking Change
The use of
xyz
as the color space name has been changed in favor ofxyz-d65
. This better matches the CSS
specification. As we are still in a prerelease state, we have not provided any backwards compatibility.CSS color input strings in the form
#!css-color color(xyz x y z)
will continue to be accepted as CSS will allow
both thexyz
and thexyz-d65
identifier, but output serialization will prefer the
#!css-color color(xyz-d65 x y z)
form as usingxyz
is an alias forxyz-d65
.Again, this breaking change only affects operations where the color space "name" is used in the API to specify usage
of a specific color space in order to create a color, convert, mutate, interpolate, etc.Color('red').convert('xyz') # Bad Color('red').convert('xyz-d65') # Okay Color('xyz' [0, 0, 0]) # Bad Color('xyz-d65' [0, 0, 0]) # Okay Color('red').interpolate('green', space='xyz') # Bad Color('red').interpolate('green', space='xyz-d65') # Okay # No changes to CSS inputs Color('color(xyz 0 0 0)') # Okay Color('color(xyz-d65 0 0 0)') # Okay
fit
method now allows additional kwargs
in its signature. The API will acceptkwargs
allowing a custom fit plugin to have configurable parameters. None of the current built-in plugins providexyz-d65
, not xyz
. Per the CSS specification, we also ensure XYZ D65xyz-d65
instead of the alias xyz
. CSS input string format will still accept the xyz
xyz-d65
, but when serializing a color to axyz-d65
will be used as the preferred form.oklch-chroma
which matches the current CSS specification. Iflch-chroma
) can manually be specified or set as the default by subclassing Color
and settingFIT
to lch-chroma
.convert
method's fit
parameter is typed appropriately and is documented correctly.Published by facelessuser almost 3 years ago
srgb-linear
as a valid color space.classmethod
instead of staticmethod
. This allows forPublished by facelessuser almost 3 years ago
color()
output format never uses percent when serializing, but will optionally accept percent as input.NAME
instead of methods space()
for color spaces and name()
for other plugins.alpha
in CHANNEL_NAMES
as the alpha
name cannot be changed.Published by facelessuser almost 3 years ago
compose
, if backdrop
list is empty, would not respect in_place
option.Published by facelessuser almost 3 years ago
contrast
, interpolate
,alpha
is not specified. When this occurs, alpha
is1
.Published by facelessuser about 3 years ago
Breaking Change
XYZ changes below will cause breakage asxyz
now refers to XYZ with D65 instead of D50. Also, CSS identifiers
changed per the recent specification change.
dir()
on Color()
, ensure dynamic methods are in the list.xyz
now refers to XYZ D65. CSS color()
function now specifies D65 color as eithercolor(xyz x y z)
or color(xyz-d65 x y z)
. XYZ D50 is now specified as color(xyz-D50 x y z)
.Published by facelessuser about 3 years ago
clip
method. clip
is still a specifiable method under the fit
function. It is also a reserved name under fit
and cannot be overridden via plugins or be removed.-
in it.Published by facelessuser about 3 years ago
First non-alpha prerelease. Notable changes from the last alpha listed below.
Breaking Changes:
There are some breaking changes if coming from the previous alpha releases. All sRGB cylindrical spaces' non-hue
data ranges are no longer scaled to 0 - 100, but use 0 - 1. Hue ranges have not changed.
#!css-color color()
functions. There is no hard rulesokhsl
and okhsv
color space.none
keyword to specify an undefined channel. They can also optionallyColor()
object accept thatcat16
chromatic adaptation.normalize
method to force channel normalization (evaluation of channels and setting undefined asaz
and bz
channels as a
and b
respectively.Color()
object appeared to behasattr()
.Published by facelessuser about 3 years ago
register
and deregister
method to allow adding new spaces, Delta E methods, or gamut mappingColor()
class is subclassed, ensure the subclass is using copies of the base class plugin mappings.metaclass
. This will prevent accidental appending and deleting of plugins on a subclassuv
and xy
values.l
and lightness
) will still recognize the more verbose alias. Others that didn't specifically use thejz
which is also lightness
) now have a more verbose alias.Published by facelessuser about 3 years ago
NaN
s are converted to normal numbers.Published by facelessuser about 3 years ago
luv
and lchuv
color space using a D50
illuminant.din99o
and din99o-lch
color space using a D65
illuminant and associated Delta EColor()
class.delta_e_<type>
methods dynamically depending on what Delta E methods are currently available.Published by facelessuser about 3 years ago
color()
function locks accepted to channels to the number of actual channels.color()
function implementations for color spaces that do not formally support such notation in the--name
. For instance, HSL, which does not support thecolor()
format in the CSS spec, is now specified via: color(--hsl h s l / a)
.color()
form. For instance,color()
format. ColorAide will nocolor(--lab)
will still support percentages for l
asPublished by facelessuser about 3 years ago
Published by facelessuser over 3 years ago
Published by facelessuser over 3 years ago
von-kries
, xyz-scaling
, cat02
, cmccat97
, cmccat2000
,sharp
. Currently, bradford
is the default and the overall preferred option.