Filter editor, RGB values wrong (off by 1)
Migrated from: https://bugs.launchpad.net/inkscape/+bug/1652850
Steps to reproduce:
- open Inkscape
- open the filter editor
- New filter (top left section)
- Add effect: Flood (select flood in the combo box and then click the add effect button to the left)
- Choose a custom colour (so you can make note of the colour value in 1.0alpha)
- Check the defs in the xml editor and find the rgb colour
- Compare. If they are identical, change (more often than not, they are different)
What happened?
At least one of the R, G, and B components seem to be off by one most of the time.
This is true for other color values in the filter editor too (namely, I checked Diffuse Lighting)
If I copy the color values from the defs (stored as rgb(r, g, b)) into the fill of an object (done in a text-editor), the color is correct in the fill and stroke editor.
The error is present even if values are stored in hex (instead of rgb()).
Test cases:
See floodfill.svg for an example OP Alvin Penner
See mpl1.svg for an example from OP
See floodfill_2.svg for an example from me
For an example, in Alvin Penner's test case, there are two flood colors:
flood-color="rgb(126,127,128)"
and flood-color="rgb(129,130,131)"
In 1.0alpha, the filter editor gives #7E7F80 or 126, 127, 128
(correct) and #808182 or 128, 129, 130
(wrong).
Alvin Penner noted that
values up to 128 are displayed correctly, values above 128 are too low by 1 count
I have found cases where this was not true when inputting the colors, but on reopen, it is true in all test cases I've used (my test case was meant to be a counter example, but I reopened it and it was not)
Inkscape Version and Operating System:
- Inkscape 1.0alpha (e2c3b8f189, 2019-05-09)
- Inkscape 0.92.4 (5095c1b47b, 2019-04-30) build, Linux Mint 19.1
- Inkscape 0.92pre3 15195 Windows 10
- Inkscape 0.92pre4 15278 Windows 10