Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions draw.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,17 @@ var (
switch attr.Name.Local {
case "offset":
stop.Offset, err = readFraction(attr.Value)
case "style":
for _, style := range strings.Split(attr.Value, ";") {
keyValue := strings.SplitN(style, ":", 2)
switch keyValue[0] {
case "stop-color":
//todo: add current color inherit
stop.StopColor, err = ParseSVGColor(keyValue[1])
case "stop-opacity":
stop.Opacity, err = parseFloat(keyValue[1], 64)
}
}
case "stop-color":
//todo: add current color inherit
stop.StopColor, err = ParseSVGColor(attr.Value)
Expand Down