Loading controllers/isogrids/banner.go +2 −1 Original line number Diff line number Diff line Loading @@ -35,10 +35,11 @@ func BannerRandom(w http.ResponseWriter, r *http.Request) { } else { colors = append(colors, bg, fg) } prob := extract.Probability(r, 1/float64(len(colors))) xt := extract.XTriangles(r) write.ImageSVG(w) isogrids.Random(w, "", colors, width, height, xt) isogrids.Random(w, "", colors, width, height, xt, prob) } // BannerRandomGradinet handler for /isogrids/banner/random/gradient. Loading controllers/isogrids/gradient.go +2 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,8 @@ func BannerGradient(w http.ResponseWriter, r *http.Request) { colors = append(colors, bg, fg) gColors = []color.RGBA{bg, fg} } prob := extract.Probability(r, 1/float64(len(colors))) write.ImageSVG(w) isogrids.RandomGradientColor(w, colors, gColors, gv, width, height, xtriangles) isogrids.RandomGradientColor(w, colors, gColors, gv, width, height, xtriangles, prob) } controllers/isogrids/random.go +2 −1 Original line number Diff line number Diff line Loading @@ -33,9 +33,10 @@ func Random(w http.ResponseWriter, r *http.Request) { } else { colors = append(colors, bg, fg) } prob := extract.Probability(r, 1/float64(len(colors))) size := extract.Size(r) lines := extract.Lines(r) write.ImageSVG(w) isogrids.Random(w, "", colors, size, size, lines) isogrids.Random(w, "", colors, size, size, lines, prob) } controllers/isogrids/randomMirror.go +2 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,8 @@ func RandomMirror(w http.ResponseWriter, r *http.Request) { } else { colors = append(colors, bg, fg) } prob := extract.Probability(r, 1/float64(len(colors))) write.ImageSVG(w) isogrids.RandomMirror(w, "", colors, size) isogrids.RandomMirror(w, "", colors, size, prob) } controllers/squares/banner.go +3 −3 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ func BannerRandom(w http.ResponseWriter, r *http.Request) { width := extract.Width(r) height := extract.Height(r) xsquares := extract.XSquares(r) numColors := extract.NumColors(r) colorMap := colors.MapOfColorThemes() Loading @@ -36,15 +35,16 @@ func BannerRandom(w http.ResponseWriter, r *http.Request) { } else { colors = append(colors, bg, fg) } prob := extract.Probability(r, 1/float64(len(colors))) if f := extract.Format(r); f == format.JPEG { m := image.NewRGBA(image.Rect(0, 0, width, height)) squares.RandomGrid(m, colors, xsquares) squares.RandomGrid(m, colors, xsquares, prob) var img image.Image = m write.ImageJPEG(w, &img) } else if f == format.SVG { write.ImageSVG(w) squares.RandomGridSVG(w, colors, width, height, xsquares) squares.RandomGridSVG(w, colors, width, height, xsquares, prob) } } Loading Loading
controllers/isogrids/banner.go +2 −1 Original line number Diff line number Diff line Loading @@ -35,10 +35,11 @@ func BannerRandom(w http.ResponseWriter, r *http.Request) { } else { colors = append(colors, bg, fg) } prob := extract.Probability(r, 1/float64(len(colors))) xt := extract.XTriangles(r) write.ImageSVG(w) isogrids.Random(w, "", colors, width, height, xt) isogrids.Random(w, "", colors, width, height, xt, prob) } // BannerRandomGradinet handler for /isogrids/banner/random/gradient. Loading
controllers/isogrids/gradient.go +2 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,8 @@ func BannerGradient(w http.ResponseWriter, r *http.Request) { colors = append(colors, bg, fg) gColors = []color.RGBA{bg, fg} } prob := extract.Probability(r, 1/float64(len(colors))) write.ImageSVG(w) isogrids.RandomGradientColor(w, colors, gColors, gv, width, height, xtriangles) isogrids.RandomGradientColor(w, colors, gColors, gv, width, height, xtriangles, prob) }
controllers/isogrids/random.go +2 −1 Original line number Diff line number Diff line Loading @@ -33,9 +33,10 @@ func Random(w http.ResponseWriter, r *http.Request) { } else { colors = append(colors, bg, fg) } prob := extract.Probability(r, 1/float64(len(colors))) size := extract.Size(r) lines := extract.Lines(r) write.ImageSVG(w) isogrids.Random(w, "", colors, size, size, lines) isogrids.Random(w, "", colors, size, size, lines, prob) }
controllers/isogrids/randomMirror.go +2 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,8 @@ func RandomMirror(w http.ResponseWriter, r *http.Request) { } else { colors = append(colors, bg, fg) } prob := extract.Probability(r, 1/float64(len(colors))) write.ImageSVG(w) isogrids.RandomMirror(w, "", colors, size) isogrids.RandomMirror(w, "", colors, size, prob) }
controllers/squares/banner.go +3 −3 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ func BannerRandom(w http.ResponseWriter, r *http.Request) { width := extract.Width(r) height := extract.Height(r) xsquares := extract.XSquares(r) numColors := extract.NumColors(r) colorMap := colors.MapOfColorThemes() Loading @@ -36,15 +35,16 @@ func BannerRandom(w http.ResponseWriter, r *http.Request) { } else { colors = append(colors, bg, fg) } prob := extract.Probability(r, 1/float64(len(colors))) if f := extract.Format(r); f == format.JPEG { m := image.NewRGBA(image.Rect(0, 0, width, height)) squares.RandomGrid(m, colors, xsquares) squares.RandomGrid(m, colors, xsquares, prob) var img image.Image = m write.ImageJPEG(w, &img) } else if f == format.SVG { write.ImageSVG(w) squares.RandomGridSVG(w, colors, width, height, xsquares) squares.RandomGridSVG(w, colors, width, height, xsquares, prob) } } Loading