|
|
|
internal/seedmark/primitives.go raw
| 1 | package seedmark | | 2 | | | 3 | import "strconv" | | 4 | | | 5 | func num(value float64) string { return strconv.FormatFloat(value, 'f' , -1, 64) } | | 6 | | | 7 | func circle(x, y, radius float64, fill string) string { | | 8 | return `<circle cx="` + num(x) + `" cy="` + num(y) + `" r="` + num(radius) + `" fill="` + fill + `"/>` | | 9 | } | | 10 | | | 11 | func ellipse(x, y, rx, ry float64, fill string) string { | | 12 | return `<ellipse cx="` + num(x) + `" cy="` + num(y) + `" rx="` + num(rx) + `" ry="` + num(ry) + `" fill="` + fill + `"/>` | | 13 | } | | 14 | | | 15 | func rect(x, y, width, height, rx float64, fill string) string { | | 16 | return `<rect x="` + num(x) + `" y="` + num(y) + `" width="` + num(width) + `" height="` + num(height) + `" rx="` + num(rx) + `" fill="` + fill + `"/>` | | 17 | } | | 18 | | | 19 | func path(d, fill string) string { return strokePath(d, fill, "none" , 0) } | | 20 | | | 21 | func strokePath(d, fill, stroke string, width float64) string { | | 22 | return `<path d="` + d + `" fill="` + fill + `" stroke="` + stroke + `" stroke-width="` + num(width) + `" stroke-linecap="round" stroke-linejoin="round"/>` | | 23 | } | | 24 | | | 25 | func group(body, transform string) string { | | 26 | return `<g transform="` + transform + `">` + body + `</g>` | | 27 | } |
|
|
About| owner | c01503e8035f |
|---|
| visibility | public |
|---|
| head | d730679639bf |
|---|
Maintainers- c01503e8035f owner
- ba1b5beed5b5 agent hermes
Clonehttps://012.run/npub1cq2s86qrtadf36eqq3epm38wmhdynrrcwxf84eldk3f94dkv7ttsrulrz5/tinyrelay.git
|