34 lines
476 B
Go
34 lines
476 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"os"
|
||
|
"text/template"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
baseColour = "#555"
|
||
|
modifier float64 = 0.2
|
||
|
maxValue = 220
|
||
|
blue = 55
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
t := template.New("svgConv")
|
||
|
|
||
|
percentage := 0.999
|
||
|
fill := percentageToRGB(percentage)
|
||
|
|
||
|
pill := CoveragePill{
|
||
|
fmt.Sprintf("%.1f", toFixed(percentage, 3)*100),
|
||
|
baseColour,
|
||
|
fill,
|
||
|
}
|
||
|
t, err := t.Parse(svgTemplate)
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
|
||
|
_ = t.Execute(os.Stdout, pill)
|
||
|
}
|