Fix color_negative.py for HSL colors

What does the merge request do?

Fixes Color > Negative extension so it can properly handle HSL colors (and possibly other non-RGB colors).

Implementation notes

The first commit adds a test case to show the issue when processing HSL color. In this case the colors is incorrectly converted to white because the color_negative.py assumes the color is RGB and tries to substract 255 from the second and third values.

Color mismatch, test:17 hsl(232, 50, 50) != hsl(203, 100, 100)

The second commit fixes the issue by forcing the colors to be converted to RGB before modify_color runs.

Summary for release notes

Fix Color > Negative extension for HSL colors

Checklist

  • Add unit tests (if applicable)
  • Changes to inkex/ are well documented
  • Clean merge request history

Merge request reports

Loading