SvgId
An ID tied to some reusable SVG element.
Useful as a way to get a reference to IDs for gradients and patterns.
For example:
Svg(...) {
val goldToOrangeGradientId = SvgId("goldToOrangeGradient")
Defs {
LinearGradient(goldToOrangeGradientId) {
Stop(10.percent, Colors.Gold)
Stop(90.percent, Colors.DarkOrange)
}
}
Circle {
cx(100); cy(100); r(50)
fill(goldToOrangeGradientId)
}
}
Content copied to clipboard