Loading draw/squares/gradient.go +1 −7 Original line number Diff line number Diff line package squares import ( "fmt" "image/color" "math" "net/http" Loading @@ -20,7 +19,7 @@ func RandomGradientSVG(w http.ResponseWriter, colors, gColors []color.RGBA, gv c step := uint8(100 / len(gColors)) for i, c := range gColors { gradientColors[i] = svg.Offcolor{percentage, RGBToHex(c.R, c.G, c.B), 1} gradientColors[i] = svg.Offcolor{percentage, draw.RGBToHex(c.R, c.G, c.B), 1} percentage += step } Loading Loading @@ -66,8 +65,3 @@ func RandomGradientSVG(w http.ResponseWriter, colors, gColors []color.RGBA, gv c } canvas.End() } // RGBToHex converts an RGB triple to an Hex string. func RGBToHex(r, g, b uint8) string { return fmt.Sprintf("#%02X%02X%02X", r, g, b) } draw/tools.go +5 −0 Original line number Diff line number Diff line Loading @@ -78,3 +78,8 @@ func PickIndex(key string, n int, index int) int { } return 0 } // RGBToHex converts an RGB triple to an Hex string. func RGBToHex(r, g, b uint8) string { return fmt.Sprintf("#%02X%02X%02X", r, g, b) } Loading
draw/squares/gradient.go +1 −7 Original line number Diff line number Diff line package squares import ( "fmt" "image/color" "math" "net/http" Loading @@ -20,7 +19,7 @@ func RandomGradientSVG(w http.ResponseWriter, colors, gColors []color.RGBA, gv c step := uint8(100 / len(gColors)) for i, c := range gColors { gradientColors[i] = svg.Offcolor{percentage, RGBToHex(c.R, c.G, c.B), 1} gradientColors[i] = svg.Offcolor{percentage, draw.RGBToHex(c.R, c.G, c.B), 1} percentage += step } Loading Loading @@ -66,8 +65,3 @@ func RandomGradientSVG(w http.ResponseWriter, colors, gColors []color.RGBA, gv c } canvas.End() } // RGBToHex converts an RGB triple to an Hex string. func RGBToHex(r, g, b uint8) string { return fmt.Sprintf("#%02X%02X%02X", r, g, b) }
draw/tools.go +5 −0 Original line number Diff line number Diff line Loading @@ -78,3 +78,8 @@ func PickIndex(key string, n int, index int) int { } return 0 } // RGBToHex converts an RGB triple to an Hex string. func RGBToHex(r, g, b uint8) string { return fmt.Sprintf("#%02X%02X%02X", r, g, b) }