What is the difference in opacity
vs fill-opacity
in SVG?
I referred the docs for fill-opacity and opacity but I am confused what is meant by
I found this table helpful when considering which flavor of opacity
to use with SVG
. Let's not forget about stroke-opacity
and stop-opacity
.
| Attribute | Explanation | Applies to: |
|:--------------:|:----------------------------------:|:------------------------------------:|
| opacity | The overall opacity of the element.| Everything but gradient stops |
| fill-opacity | The opacity of the fill paint. | Elements with the attribute 'fill' |
| stroke-opacity | The opacity of the stroke paint. | Elements with the attribute 'stroke' |
| stop-opacity | The opacity of the gradient stop. | Gradient stops |