Color Refactoring (extensions)
What does the merge request do?
Rewrites how colors are parsed and manipulated.
Implementation notes
There are some deprecations, some of these are to make restrictions similar to what is found in the C++ color code:
- Using
color.to_rgba()is deprecated in favour ofcolor.to_rgb().with_opacity() - Making a color with
Color([numbers])without a color space is deprecated, useColor([numbers], "rgb")to be explicit. - Empty colors in a color space (like rgb) will now not exist. Color() is "none" and
Color().to_rgb()converts to black.
Summary for release notes
Support for this branch:
-
None type -
RGB, hex, css-rgb, css-rgba, integers -
Named, css-names -
HSL, css-hsl, css-hsla -
HSV, css-hwb, css-hwba -
DeviceCMYK colors -
icc-profile colors
Other colors are possible, but we're going to limit what we're supporting here for now to just the major components.
Checklist
-
Add unit tests (if applicable) -
Changes to inkex/are well documented -
Clean merge request history
Edited by Martin Owens