When you have fill set in rgb format, the fill-opacity is then not respected.
This produce opaque image, but it should be 50% transparent:
`
`
When we have fill set in hex color, then the image is correctly semitransparent:
`
`
Problem is this condition, in file src/Svg/Style.php on line 165:
if ($value !== null && $value[3] !== 1 && array_key_exists("{$from}-opacity", $style_map) === true) {
because $value[3] is number, when color is in hex format, but string when color is in rgb/rgba/hsl format. After I changed to this, the svg is correct:
if ($value !== null && $value[3] != 1 && array_key_exists("{$from}-opacity", $style_map) === true) {
The issue appears to be that we were treating the parsed color value inconsistently. I modified the logic so that the parsed components are more consistently returned and handled as decimal values.
When you have fill set in rgb format, the fill-opacity is then not respected.
This produce opaque image, but it should be 50% transparent: `
`
When we have fill set in hex color, then the image is correctly semitransparent: `
`
Problem is this condition, in file src/Svg/Style.php on line 165:
if ($value !== null && $value[3] !== 1 && array_key_exists("{$from}-opacity", $style_map) === true) {
because $value[3] is number, when color is in hex format, but string when color is in rgb/rgba/hsl format. After I changed to this, the svg is correct:if ($value !== null && $value[3] != 1 && array_key_exists("{$from}-opacity", $style_map) === true) {