Converting a solid color to a gradient leaves the fill-opacity attribute unexposed
Summary:
Using the Fill and Stroke dialog to change a solid color to a gradient will not remove the fill-opacity or stroke-opacity attribute from the object. This will seemingly permanently affect the opacity of the fill or stroke (whichever the gradient is on). The canvas does not show the effect immediately.
Steps to reproduce:
- Open Inkscape
- Make a rectangle
- Set its fill color to 00000033 (or any alpha below 100)
- In the Fill and Stroke dialog, on the "fill" tab, click "linear gradient" at the top
- Set the alpha of both stops to 100 (optional, but more clearly shows the issue)
- Drag the opacity slider at the bottom to the right (even if it was already at 100), or save and re-open the file
What happened?
When you do the last step, the fill alpha as seen on the canvas will be decreased, even if all stops and the opacity slider are at 100%.
The effective alpha of a stop is the original solid fill's alpha multiplied by the stop's alpha. That original is actually preserved in the object as the fill-opacity attribute. This setting is not accessible in the Fill and Stroke dialog after you make the gradient.
Doing the same thing with stroke causes the same bug with stroke-opacity.
What should have happened?
Probably, fill-opacity (or stroke-opacity) should have been removed or set to 1 when the gradient was made, since the value was copied to a stop's alpha.
Sample attachments:
Version info
Inkscape 1.4.2 (f4327f4, 2025-05-13)
Compile (Run)
GLib version: 2.84.0
GTK version: 3.24.49 (3.24.49)
glibmm version: 2.66.7
gtkmm version: 3.24.9
libxml2 version: 2.12.10
libxslt version: 1.1.43
Cairo version: 1.18.4 (1.18.4)
Pango version: 1.56.3 (1.56.3)
HarfBuzz version: 10.4.0 (10.4.0)
OS version: Windows 11 24H2