Skip to content

Releases: facelessuser/coloraide

0.14.2

26 Mar 02:28
Compare
Choose a tag to compare
0.14.2 Pre-release
Pre-release

0.14.2

  • FIX: Fix rare issue where precision adjustment could fail.
  • FIX: Fix util.divide logic when dividing a number or vector by a matrix. There are no actual usage of these
    cases in the code but fixed in case they are used in the future.
  • FIX: Minor performance improvements.

0.14.1

24 Mar 02:08
Compare
Choose a tag to compare
0.14.1 Pre-release
Pre-release

0.14.1

  • FIX: Fix bug related to parsing strings without full matching.

0.14.0

24 Mar 00:54
Compare
Choose a tag to compare
0.14.0 Pre-release
Pre-release

0.14.0

Note
No changes should break existing color space plugins. Moved objects and references are still also available in old
locations, and new functionality is implemented in such a way as to not break existing plugins, but plugins should
be updated as sometime before the 1.0 release, such legacy access will be removed.

  • NEW: Faster parsing. Instead of parsing the color(space ...) format each a different color space is evaluated,
    generically parse it once and then associate it with a registered color space. If a color space wishes to opt out of
    the color(space ...) input format, the space should set COLOR_FORMAT to False. This means there is no need to
    call super.match() when overriding Color.match() to ensure support for the color(space ...) format as it will be
    handled unless COLOR_FORMAT is turned off. DEFAULT_MATCH usage should also be discontinued as it now does nothing.
  • NEW: Other speed optimizations.
  • NEW: All CSS parsing and serialization is now contained in a single module at coloraide.css. This simplifies
    the current color space classes greatly when it comes to supporting CSS specific formats.
  • NEW: Move our white space mapping to the cat module as it makes more sense there.
  • NEW: GamutBound, GamutUnbound, and associated flags are now contained under coloraide.gamut.bounds.
  • NEW: normalize will also remove masked values to properly adjust the color.
  • FIX: Compositing and blending should not "fit" colors before applying, it is only specified that the range should
    be clamped at the end of blending.
  • FIX: Fix issue where a subclassed Color() object could not recognize the base class or other subclasses.

0.13.0

19 Mar 00:32
Compare
Choose a tag to compare
0.13.0 Pre-release
Pre-release

0.13.0

  • NEW: Add new closest method that takes a list of colors and returns the one that is closet to the calling color
    object.
  • NEW: CSS color syntax no longer allows for forgiving channels in color(). This means that when a channel other
    than alpha is omitted, we will no longer treat them as undefined. Instead, the color will simply fail to parse.
    Raw data channels also must specify all channels.
  • NEW: Clamp lower bounds of chroma at the channel level.
  • NEW: coloraide.spaces.WHITES is now a 2 deep dictionary containing both 2˚ and 10˚ observer variants of white
    points.
  • NEW: Color space plugins now specify WHITE as a tuple with the x and y chromaticity coordinates. This allows a
    space to specify unknown white points if desired.
  • FIX: Fix longer hue interpolation when θ1 - θ2 = 0. The spec is wrong in this case, and interpolation should
    still occur the long way around instead of keeping hue constant.
  • FIX: Reduce redundancy in some CSS parsing patterns.
  • FIX: Minor performance improvements.
  • FIX: Legacy rgb(), rgba(), hsl(), and hsla() comma separated forms in CSS do not support none, only the
    new space separated forms do.
  • FIX: Ensure py.typed is installed with package so that type annotations work properly.

0.12.0

12 Mar 02:43
Compare
Choose a tag to compare
0.12.0 Pre-release
Pre-release

0.12.0

  • NEW: Add a gamut mapping variant that matches the CSS Color Level 4 spec.
  • FIX: Fix precision rounding issue.

0.11.0

05 Mar 18:53
Compare
Choose a tag to compare
0.11.0 Pre-release
Pre-release

0.11.0

Warning: Breaking Changes

  1. 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
    call normalize 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)
  2. 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 like hwb(), 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.

  3. 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 and luv and lchuv 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.

  4. Renamed DIN99o Lch identifier to the short name of lch99o.>

  • NEW: ColorAide now only ships with the D65 version Luv and LCHuv as D65, in most places is the expected white
    space. Now, the identifier luv and lchuv will refer to the D65 version of the respective color spaces. D50
    variants are no longer available by default.
  • NEW: Add the HSLuv color space.
  • NEW: DIN99o Lch identifier was renamed from din99o-lch to lch99o. To use in CSS color() form, use
    --lch99o.
  • NEW: Refactor chroma reduction/MINDE logic to cut processing time in half. Gamut mapping results remain very
    similar.
  • NEW: Be more strict with CSS inputs and outputs. hwb(), lab(), lch(), oklab(), and oklch() no longer
    support comma string formats.
  • NEW: Officially drop Python 3.6 support.
  • FIX: Do not assume user defined, powerless hues as undefined. If they are defined by the user, they should be
    respected, even if they have no effect on the current color. This helps to ensure interpolations acts in an
    unsurprising way. If a user manually specifies the channel with none, then it will be considered undefined, or if
    the color goes through a conversion to a space that cannot pick an appropriate hue, they will also be undefined.

0.10.0

19 Feb 05:35
214c6e0
Compare
Choose a tag to compare
0.10.0 Pre-release
Pre-release

0.10.0

  • NEW: Switch back to using CIELCH for gamut mapping (lch-chroma). There are still some edge cases that make
    oklch-chroma less desirable.
  • FIX: Fix an issue where when attempting to generate steps some ∆E distance apart, the maximum step range was not
    respected and could result in large hangs.

0.9.0

17 Feb 06:43
Compare
Choose a tag to compare
0.9.0 Pre-release
Pre-release

0.9.0

Warning: Breaking Change
Custom gamut mapping plugins no longer return coordinates and require the method to update the passed in color.

  • NEW: Improved, faster gamut mapping algorithm.
  • NEW: FIT plugins (gamut mapping) no longer return coordinates but should modify the color passed in.
  • NEW: Expose default interpolation space as a class variable that can be controlled when creating a custom class
    via class inheritance.
  • NEW: Colors can now directly specify the ∆E method that is used when interpolating color steps and using
    max_delta_e via the new delta_e argument. If the delta_e parameter is omitted, the color object's default ∆E
    method will be used.
  • NEW: Oklab is now the default interpolation color space.
  • NEW: Interpolation will now avoid fitting colors that are out of gamut unless the color space cannot represent
    out of gamut colors. Currently, all of the RGB colors (srgb, display-p3, etc.) all support extended ranges, but
    the HSL, HWB, and HSV color models for srgb (including spaces such as okhsl and okhsv) do not support extended
    ranges and will still be gamut mapped.
  • FIX: Remove some incorrect code from the gamut mapping algorithm that would shortcut the mapping to reduce chroma
    to zero.

0.8.0

21 Dec 17:12
Compare
Choose a tag to compare
0.8.0 Pre-release
Pre-release

0.8.0

Warning: Breaking Change

The use of xyz as the color space name has been changed in favor of xyz-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 the xyz and the xyz-d65 identifier, but output serialization will prefer the
#!css-color color(xyz-d65 x y z) form as using xyz is an alias for xyz-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
  • NEW: Custom fit plugin's fit method now allows additional kwargs in its signature. The API will accept
    kwargs allowing a custom fit plugin to have configurable parameters. None of the current built-in plugins provide
    additional parameters, but this is provided in case it is found useful in the future.
  • NEW: XYZ D65 space will now be known as xyz-d65, not xyz. Per the CSS specification, we also ensure XYZ D65
    color space serializes as xyz-d65 instead of the alias xyz. CSS input string format will still accept the xyz
    identifier as this is defined in the CSS specification as an alias for xyz-d65, but when serializing a color to a
    string, the xyz-d65 will be used as the preferred form.
  • NEW: By default, gamut mapping is done with oklch-chroma which matches the current CSS specification. If
    desired, the old way (lch-chroma) can manually be specified or set as the default by subclassing Color and setting
    FIT to lch-chroma.
  • FIX: Ensure the convert method's fit parameter is typed appropriately and is documented correctly.

0.7.0

28 Nov 16:08
Compare
Choose a tag to compare
0.7.0 Pre-release
Pre-release

0.7.0

  • NEW: Formally expose srgb-linear as a valid color space.
  • NEW: Distance plugins and gamut mapping plugins now use classmethod instead of staticmethod. This allows for
    inheritance from other classes and the overriding of plugin options included as class members.
  • NEW: Tweak Lch chroma gamut mapping threshold.
  • FIX: Issue where it is possible, when generating steps, to cause a shift in midpoint of colors if exceeding the
    maximum steps. Ensure that no stops are injected if injecting a stop between every color would exceed the max steps.