GradientNewForNode adds a new gradient specific to given node that points to given stops name. returns the new gradient and the url that points to it (nil if parent svg cannot be found). Initializes gradient to use bounding box of object, but using userSpaceOnUse setting
(n Node, radial bool, stops string)
| 205 | // and the url that points to it (nil if parent svg cannot be found). |
| 206 | // Initializes gradient to use bounding box of object, but using userSpaceOnUse setting |
| 207 | func (sv *SVG) GradientNewForNode(n Node, radial bool, stops string) (*Gradient, string) { |
| 208 | gr, url := sv.GradientNew(radial) |
| 209 | gr.StopsName = stops |
| 210 | gr.Grad.AsBase().SetBox(n.LocalBBox()) |
| 211 | sv.GradientUpdateStops(gr) |
| 212 | return gr, url |
| 213 | } |
| 214 | |
| 215 | // GradientNew adds a new gradient, either linear or radial, |
| 216 | // with a new unique id |
no test coverage detected