Loading controllers/isogrids/random.go +4 −5 Original line number Diff line number Diff line Loading @@ -15,11 +15,7 @@ import ( func Random(w http.ResponseWriter, r *http.Request) { colorMap := colors.MapOfColorThemes() size := extract.Size(r) numColors := extract.NumColors(r) bg, fg := extract.ExtraColors(r, colorMap) theme := extract.Theme(r) if val, ok := colorMap[theme]; ok { bg = val[0] Loading @@ -29,6 +25,7 @@ func Random(w http.ResponseWriter, r *http.Request) { var colors []color.RGBA if theme != "base" { if _, ok := colorMap[theme]; ok { numColors := extract.NumColors(r) colors = append(colors, colorMap[theme][0:numColors]...) } else { colors = append(colors, colorMap["base"]...) Loading @@ -37,6 +34,8 @@ func Random(w http.ResponseWriter, r *http.Request) { colors = append(colors, bg, fg) } size := extract.Size(r) lines := extract.Lines(r) write.ImageSVG(w) isogrids.Random(w, "", colors, size) isogrids.Random(w, "", colors, size, lines) } draw/isogrids/isogrids.go +1 −2 Original line number Diff line number Diff line Loading @@ -10,11 +10,10 @@ import ( ) // Random creates an isogrids svg image with half diagonals. func Random(w http.ResponseWriter, key string, colors []color.RGBA, size int) { func Random(w http.ResponseWriter, key string, colors []color.RGBA, size, lines int) { canvas := svg.New(w) canvas.Start(size, size) lines := 10 fringeSize := size / lines // triangle grid here: Loading Loading
controllers/isogrids/random.go +4 −5 Original line number Diff line number Diff line Loading @@ -15,11 +15,7 @@ import ( func Random(w http.ResponseWriter, r *http.Request) { colorMap := colors.MapOfColorThemes() size := extract.Size(r) numColors := extract.NumColors(r) bg, fg := extract.ExtraColors(r, colorMap) theme := extract.Theme(r) if val, ok := colorMap[theme]; ok { bg = val[0] Loading @@ -29,6 +25,7 @@ func Random(w http.ResponseWriter, r *http.Request) { var colors []color.RGBA if theme != "base" { if _, ok := colorMap[theme]; ok { numColors := extract.NumColors(r) colors = append(colors, colorMap[theme][0:numColors]...) } else { colors = append(colors, colorMap["base"]...) Loading @@ -37,6 +34,8 @@ func Random(w http.ResponseWriter, r *http.Request) { colors = append(colors, bg, fg) } size := extract.Size(r) lines := extract.Lines(r) write.ImageSVG(w) isogrids.Random(w, "", colors, size) isogrids.Random(w, "", colors, size, lines) }
draw/isogrids/isogrids.go +1 −2 Original line number Diff line number Diff line Loading @@ -10,11 +10,10 @@ import ( ) // Random creates an isogrids svg image with half diagonals. func Random(w http.ResponseWriter, key string, colors []color.RGBA, size int) { func Random(w http.ResponseWriter, key string, colors []color.RGBA, size, lines int) { canvas := svg.New(w) canvas.Start(size, size) lines := 10 fringeSize := size / lines // triangle grid here: Loading