Loading .gitignore +4 −1 Original line number Diff line number Diff line Loading @@ -23,3 +23,6 @@ _testmain.go *.test *~ *.DS_Store *_got *_expected No newline at end of file draw/isogrids/gradient.go +2 −3 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ package isogrids import ( "image/color" "net/http" "io" svg "github.com/ajstarks/svgo" "github.com/taironas/tinygraphs/colors" Loading @@ -11,8 +11,7 @@ import ( // RandomGradientColor builds a isogrid image with with x colors selected at random for each quadrant. // the background color stays the same the other colors get mixed in a gradient color from the first one to the last one. func RandomGradientColor(w http.ResponseWriter, colors, gColors []color.RGBA, gv colors.GradientVector, width, height, lines int, prob float64) { func RandomGradientColor(w io.Writer, colors, gColors []color.RGBA, gv colors.GradientVector, width, height, lines int, prob float64) { var gradientColors []svg.Offcolor gradientColors = make([]svg.Offcolor, len(gColors)) percentage := uint8(0) Loading draw/isogrids/hexa.go +3 −3 Original line number Diff line number Diff line Loading @@ -2,14 +2,14 @@ package isogrids import ( "image/color" "net/http" "io" "github.com/ajstarks/svgo" svg "github.com/ajstarks/svgo" "github.com/taironas/tinygraphs/draw" ) // Hexa builds an image with lines x lines grids of half diagonals in the form of an hexagon func Hexa(w http.ResponseWriter, key string, colors []color.RGBA, size, lines int) { func Hexa(w io.Writer, key string, colors []color.RGBA, size, lines int) { canvas := svg.New(w) canvas.Start(size, size) Loading draw/isogrids/hexa16.go +3 −3 Original line number Diff line number Diff line Loading @@ -3,16 +3,16 @@ package isogrids import ( "errors" "image/color" "net/http" "io" "github.com/ajstarks/svgo" svg "github.com/ajstarks/svgo" "github.com/taironas/tinygraphs/draw" ) // Hexa16 builds an image with lines x lines grids of half diagonals in the form of an hexagon // it draws 6 triangles, triangle 1 to 5 are all rotations of triangle 0. // triangle zero triangle on the center left. func Hexa16(w http.ResponseWriter, key string, colors []color.RGBA, size, lines int) { func Hexa16(w io.Writer, key string, colors []color.RGBA, size, lines int) { canvas := svg.New(w) canvas.Start(size, size) Loading draw/isogrids/isogrids.go +3 −3 Original line number Diff line number Diff line Loading @@ -2,14 +2,14 @@ package isogrids import ( "image/color" "net/http" "io" "github.com/ajstarks/svgo" svg "github.com/ajstarks/svgo" "github.com/taironas/tinygraphs/draw" ) // Isogrids builds an image with 10x10 grids of half diagonals func Isogrids(w http.ResponseWriter, key string, colors []color.RGBA, size, lines int) { func Isogrids(w io.Writer, key string, colors []color.RGBA, size, lines int) { canvas := svg.New(w) canvas.Start(size, size) Loading Loading
.gitignore +4 −1 Original line number Diff line number Diff line Loading @@ -23,3 +23,6 @@ _testmain.go *.test *~ *.DS_Store *_got *_expected No newline at end of file
draw/isogrids/gradient.go +2 −3 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ package isogrids import ( "image/color" "net/http" "io" svg "github.com/ajstarks/svgo" "github.com/taironas/tinygraphs/colors" Loading @@ -11,8 +11,7 @@ import ( // RandomGradientColor builds a isogrid image with with x colors selected at random for each quadrant. // the background color stays the same the other colors get mixed in a gradient color from the first one to the last one. func RandomGradientColor(w http.ResponseWriter, colors, gColors []color.RGBA, gv colors.GradientVector, width, height, lines int, prob float64) { func RandomGradientColor(w io.Writer, colors, gColors []color.RGBA, gv colors.GradientVector, width, height, lines int, prob float64) { var gradientColors []svg.Offcolor gradientColors = make([]svg.Offcolor, len(gColors)) percentage := uint8(0) Loading
draw/isogrids/hexa.go +3 −3 Original line number Diff line number Diff line Loading @@ -2,14 +2,14 @@ package isogrids import ( "image/color" "net/http" "io" "github.com/ajstarks/svgo" svg "github.com/ajstarks/svgo" "github.com/taironas/tinygraphs/draw" ) // Hexa builds an image with lines x lines grids of half diagonals in the form of an hexagon func Hexa(w http.ResponseWriter, key string, colors []color.RGBA, size, lines int) { func Hexa(w io.Writer, key string, colors []color.RGBA, size, lines int) { canvas := svg.New(w) canvas.Start(size, size) Loading
draw/isogrids/hexa16.go +3 −3 Original line number Diff line number Diff line Loading @@ -3,16 +3,16 @@ package isogrids import ( "errors" "image/color" "net/http" "io" "github.com/ajstarks/svgo" svg "github.com/ajstarks/svgo" "github.com/taironas/tinygraphs/draw" ) // Hexa16 builds an image with lines x lines grids of half diagonals in the form of an hexagon // it draws 6 triangles, triangle 1 to 5 are all rotations of triangle 0. // triangle zero triangle on the center left. func Hexa16(w http.ResponseWriter, key string, colors []color.RGBA, size, lines int) { func Hexa16(w io.Writer, key string, colors []color.RGBA, size, lines int) { canvas := svg.New(w) canvas.Start(size, size) Loading
draw/isogrids/isogrids.go +3 −3 Original line number Diff line number Diff line Loading @@ -2,14 +2,14 @@ package isogrids import ( "image/color" "net/http" "io" "github.com/ajstarks/svgo" svg "github.com/ajstarks/svgo" "github.com/taironas/tinygraphs/draw" ) // Isogrids builds an image with 10x10 grids of half diagonals func Isogrids(w http.ResponseWriter, key string, colors []color.RGBA, size, lines int) { func Isogrids(w io.Writer, key string, colors []color.RGBA, size, lines int) { canvas := svg.New(w) canvas.Start(size, size) Loading