1.0b1 #198
Closed
facelessuser
announced in
Announcements
1.0b1
#198
Replies: 0 comments
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.
-
1.0b1
BREAK: The
coloraide.Colorobject now only registers a subset of the available color spaces and ∆E algorithms inorder to create a lighter default color object.
coloraide.ColorAllhas been provided for a quick way to get accessto all available color spaces and plugins. Generally, it is recommend to subclass
Colorand register just what isdesired.
BREAK: Reworked interpolation:
interpolateandstepsfunctions are now@classmethods. This alleviates the awkward handling of interpolatingcolors greater than 2. Before, the first color always had to be an instance and then the rest had to be fed into
that instance, now the the methods can be called from the base class or an instance with all the colors fed in
via a list. Only the colors in the list will be evaluated during interpolation.
Piecewiseobject has been removed.stopobjects are used to wrap colors to apply a new color stop.hintfunction has been provided to simulate CSS color hinting.hintreturns an easing function that modifiesthe midpoint to the specified point between two color stops.
interpolate,steps, ormixthe interpolationstyle can be changed via the
methodparameter.bezierandlinearare available withlinearbeing thedefault.
BREAK: Dictionary input/output now matches the following format (where alpha is optional):
{"space": "name", "coords": [0, 0, 0], "alpha": 1}This allows for quicker processing and less complexity dealing with channel names and aliases.
BREAK: The CSS Level 4 Color spec has accepted our proposed changes to the gamut mapping algorithm. With this
change, the
oklch-chromagamut mapping algorithm is now compliant with the CSS spec, andcss-color-4is no longerneeded. If you were experimenting with
css-color-4, please useoklch-chromainstead. The algorithm is faster anddoes not have the color banding issue that
css-color-4had, and it is now exactly the same as the CSS spec.BREAK: New breaking change. Refactor of
Spaceplugins.Spaceplugins are no longer instantiated which cutsdown on overhead lending to better performance.
BOUNDSandCHANNEL_NAMESattributes were combined into oneattribute called
CHANNELSwhich serves the same purpose as the former attributes.Spaceplugins also no longerneed to define channel property accessors as those are handled through
CHANNELSin a more generic way. This is abreaking change for any custom plugins.
Additionally, the
Spaceplugin'snull_adjustmethod has been renamed asnormalizematching its functionalityand usage in regards to the
Colorobject. It no longer accepts color coordinates and alpha channel coordinatesseparately, but will receive them as a single list and return them as such.
BREAK:
Color'sfitandclipmethods now perform the operation in place, modifying the current colordirectly. The
in_placeparameter has been removed. To create a new color when performing these actions, simply clonethe color first:
#!py color.clone().clip().BREAK: Remove deprecated dynamic properties which helps to increase speed by removing overhead on class property
access.
BREAK: Remove deprecated dynamic properties which helps to increase speed by removing overhead on class property
access. Use indexing instead:
color['red']orcolor[0].BREAK: Remove deprecated
coords()method. Use indexing and slices instead:color[:-1].NEW: Update
lch(),lab(),oklch(), andoklab()to optionally support percentages for lightness, chroma, a,and b. Lightness is no longer enforced to be a percentage in the CSS syntax and these spaces will serialize as a
number by default instead. Optionally, these forms can force a percentage output via the
to_stringmethod when usingthe
percentageoption. Percent ranges roughly correspond with the Display P3 gamut per the CSS specification.Additionally, CSS color spaces using the
color()format as an input will translate using these same ranges if thechannels are percentages.
huewill also be respected and treated as 0 - 360 when using a percentage.Non-CSS color spaces will also respect their defined ranges when using percentages in the
color()form.NEW: Add
silentoption toderegisterso that if a proper category is specified, and the plugin does not exit,the operation will not throw an error.
NEW: Add new color spaces:
display-p3-linear,a98-rgb-linear,rec2020-linear,prophoto-rgb-linear, andrec2100pq,hsi,rlab,hunter-lab,xyy,prismatic,orgb,cmy,cmyk,ipt, andigpgtg.NEW: Monochromatic color harmony must also be performed in a cylindrical color space to make achromatic detection
easier. This means all color harmonies now must be performed under a cylindrical color space.
NEW: Use Lab D65 for ∆E 2000, ∆E 76, ∆E HyAB, Euclidean distance, and Lch D65 for Lch Chroma gamut mapping. Lab
D65 is far more commonly used for the aforementioned ∆E methods. Lch Chroma gamut mapping, which uses ∆E 2000 needs to
use the same D65 white point to avoid wasting conversion time.
FIX: Better handling of monochromatic harmonies that are near white or black.
FIX: Small fix to
steps∆E logic.This discussion was created from the release 1.0b1.
Beta Was this translation helpful? Give feedback.
All reactions