Coloraide

Latest version: v4.0

Safety actively analyzes 675368 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 12 of 18

0.10a19

- **FIX**: Ensure that subclassed `Color` objects are normalized when performing operations with more than one color to
prevent issues in case one subclassed object has overridden important functions.
- **FIX**: Spaces like `lab`, `lch`, etc., which specify certain channels as percent only should require the `color()`
format to only accept percentages for those channels and output those channels as percentages when converting to a
string.

0.10a18

- **NEW**: Refactor of internals.
- **NEW**: `interpolate` and `steps` can now accept multiple colors and will return an interpolation function that spans all
specified colors via the range of `[0..1]`.
- **NEW**: Better control over piecewise interpolation: setting stops, adjusting options per segment, etc.
- **NEW**: `compose` can now accept multiple colors and will return a result where all colors are layered on top of each
other.
- **NEW**: `new` method does not need to be a `classmethod`. Make it a normal method on the instance.
- **NEW**: Add Jzazbz and JzCzhz color spaces.
- **NEW**: Add D65 variants of CIELAB, CIELCH, and XYZ.
- **NEW**: Add ICtCp color space and Delta E ITP method.
- **FIX**: Actually make `mix` default to `lab` like `interpolate` and friends do.

0.10a10

- **FIX**: Address two divide by zero cases in HSL algorithm. Was missing some special cases when luminance equals `1` or `0`.

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

> **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.
>
> python
> 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

- **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.

Page 12 of 18

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.