Loading controllers/isogrids/banner.go +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ func BannerRandom(w http.ResponseWriter, r *http.Request) { xt := extract.XTriangles(r) write.ImageSVG(w) isogrids.Random(w, "", colors, width, height, xt, prob) isogrids.Random(w, colors, width, height, xt, prob) } // BannerRandomGradinet handler for /isogrids/banner/random/gradient. Loading @@ -32,5 +32,5 @@ func BannerRandomGradient(w http.ResponseWriter, r *http.Request) { xt := extract.XTriangles(r) write.ImageSVG(w) isogrids.RandomGradient(w, "", colors, width, height, xt) isogrids.RandomGradient(w, colors, width, height, xt) } controllers/isogrids/random.go +1 −1 Original line number Diff line number Diff line Loading @@ -18,5 +18,5 @@ func Random(w http.ResponseWriter, r *http.Request) { size := extract.Size(r) lines := extract.Lines(r) write.ImageSVG(w) isogrids.Random(w, "", colors, size, size, lines, prob) isogrids.Random(w, colors, size, size, lines, prob) } controllers/isogrids/randomMirror.go +1 −1 Original line number Diff line number Diff line Loading @@ -14,5 +14,5 @@ func RandomMirror(w http.ResponseWriter, r *http.Request) { prob := extract.Probability(r, 1/float64(len(colors))) write.ImageSVG(w) isogrids.RandomMirror(w, "", colors, size, prob) isogrids.RandomMirror(w, colors, size, prob) } draw/isogrids/random.go +3 −3 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ import ( "github.com/taironas/tinygraphs/draw" ) func Random(w http.ResponseWriter, key string, colors []color.RGBA, width, height, lines int, prob float64) { func Random(w http.ResponseWriter, colors []color.RGBA, width, height, lines int, prob float64) { canvas := svg.New(w) canvas.Start(width, height) Loading Loading @@ -50,7 +50,7 @@ func Random(w http.ResponseWriter, key string, colors []color.RGBA, width, heigh } // Random creates an isogrids svg image with half diagonals. func RandomGradient(w http.ResponseWriter, key string, colors []color.RGBA, width, height, lines int) { func RandomGradient(w http.ResponseWriter, colors []color.RGBA, width, height, lines int) { canvas := svg.New(w) canvas.Start(width, height) Loading Loading @@ -94,7 +94,7 @@ func RandomGradient(w http.ResponseWriter, key string, colors []color.RGBA, widt } // RandomMirror builds an image with 10x10 grids of half diagonals func RandomMirror(w http.ResponseWriter, key string, colors []color.RGBA, size int, prob float64) { func RandomMirror(w http.ResponseWriter, colors []color.RGBA, size int, prob float64) { canvas := svg.New(w) canvas.Start(size, size) Loading draw/isogrids/random_test.go +3 −3 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ import ( func TestRandom(t *testing.T) { rec := httptest.NewRecorder() Random(rec, key, colorTheme, 10, 10, 10, float64(50)) Random(rec, colorTheme, 10, 10, 10, float64(50)) if rec.Code != http.StatusOK { t.Errorf("returned %v. Expected %v.", rec.Code, http.StatusOK) } Loading @@ -18,7 +18,7 @@ func TestRandom(t *testing.T) { func TestRandomGradient(t *testing.T) { rec := httptest.NewRecorder() RandomGradient(rec, key, colorTheme, 10, 10, 10) RandomGradient(rec, colorTheme, 10, 10, 10) if rec.Code != http.StatusOK { t.Errorf("returned %v. Expected %v.", rec.Code, http.StatusOK) } Loading @@ -27,7 +27,7 @@ func TestRandomGradient(t *testing.T) { func TestRandomMirror(t *testing.T) { rec := httptest.NewRecorder() RandomMirror(rec, key, colorTheme, 10, float64(50)) RandomMirror(rec, colorTheme, 10, float64(50)) if rec.Code != http.StatusOK { t.Errorf("returned %v. Expected %v.", rec.Code, http.StatusOK) } Loading Loading
controllers/isogrids/banner.go +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ func BannerRandom(w http.ResponseWriter, r *http.Request) { xt := extract.XTriangles(r) write.ImageSVG(w) isogrids.Random(w, "", colors, width, height, xt, prob) isogrids.Random(w, colors, width, height, xt, prob) } // BannerRandomGradinet handler for /isogrids/banner/random/gradient. Loading @@ -32,5 +32,5 @@ func BannerRandomGradient(w http.ResponseWriter, r *http.Request) { xt := extract.XTriangles(r) write.ImageSVG(w) isogrids.RandomGradient(w, "", colors, width, height, xt) isogrids.RandomGradient(w, colors, width, height, xt) }
controllers/isogrids/random.go +1 −1 Original line number Diff line number Diff line Loading @@ -18,5 +18,5 @@ func Random(w http.ResponseWriter, r *http.Request) { size := extract.Size(r) lines := extract.Lines(r) write.ImageSVG(w) isogrids.Random(w, "", colors, size, size, lines, prob) isogrids.Random(w, colors, size, size, lines, prob) }
controllers/isogrids/randomMirror.go +1 −1 Original line number Diff line number Diff line Loading @@ -14,5 +14,5 @@ func RandomMirror(w http.ResponseWriter, r *http.Request) { prob := extract.Probability(r, 1/float64(len(colors))) write.ImageSVG(w) isogrids.RandomMirror(w, "", colors, size, prob) isogrids.RandomMirror(w, colors, size, prob) }
draw/isogrids/random.go +3 −3 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ import ( "github.com/taironas/tinygraphs/draw" ) func Random(w http.ResponseWriter, key string, colors []color.RGBA, width, height, lines int, prob float64) { func Random(w http.ResponseWriter, colors []color.RGBA, width, height, lines int, prob float64) { canvas := svg.New(w) canvas.Start(width, height) Loading Loading @@ -50,7 +50,7 @@ func Random(w http.ResponseWriter, key string, colors []color.RGBA, width, heigh } // Random creates an isogrids svg image with half diagonals. func RandomGradient(w http.ResponseWriter, key string, colors []color.RGBA, width, height, lines int) { func RandomGradient(w http.ResponseWriter, colors []color.RGBA, width, height, lines int) { canvas := svg.New(w) canvas.Start(width, height) Loading Loading @@ -94,7 +94,7 @@ func RandomGradient(w http.ResponseWriter, key string, colors []color.RGBA, widt } // RandomMirror builds an image with 10x10 grids of half diagonals func RandomMirror(w http.ResponseWriter, key string, colors []color.RGBA, size int, prob float64) { func RandomMirror(w http.ResponseWriter, colors []color.RGBA, size int, prob float64) { canvas := svg.New(w) canvas.Start(size, size) Loading
draw/isogrids/random_test.go +3 −3 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ import ( func TestRandom(t *testing.T) { rec := httptest.NewRecorder() Random(rec, key, colorTheme, 10, 10, 10, float64(50)) Random(rec, colorTheme, 10, 10, 10, float64(50)) if rec.Code != http.StatusOK { t.Errorf("returned %v. Expected %v.", rec.Code, http.StatusOK) } Loading @@ -18,7 +18,7 @@ func TestRandom(t *testing.T) { func TestRandomGradient(t *testing.T) { rec := httptest.NewRecorder() RandomGradient(rec, key, colorTheme, 10, 10, 10) RandomGradient(rec, colorTheme, 10, 10, 10) if rec.Code != http.StatusOK { t.Errorf("returned %v. Expected %v.", rec.Code, http.StatusOK) } Loading @@ -27,7 +27,7 @@ func TestRandomGradient(t *testing.T) { func TestRandomMirror(t *testing.T) { rec := httptest.NewRecorder() RandomMirror(rec, key, colorTheme, 10, float64(50)) RandomMirror(rec, colorTheme, 10, float64(50)) if rec.Code != http.StatusOK { t.Errorf("returned %v. Expected %v.", rec.Code, http.StatusOK) } Loading