Commit 8a537270 authored by santiaago's avatar santiaago
Browse files

rename functions and add comments #67

parent 5c672913
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -40,5 +40,5 @@ func BannerGradient(w http.ResponseWriter, r *http.Request) {
	}

	write.ImageSVG(w)
	squares.RandomGradientSVG(w, colors, gColors, gv, width, height, xsquares)
	squares.RandomGradientColorSVG(w, colors, gColors, gv, width, height, xsquares)
}
+2 −0
Original line number Diff line number Diff line
@@ -9,6 +9,8 @@ import (
	"github.com/taironas/tinygraphs/draw"
)

// 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) {

	var gradientColors []svg.Offcolor
+3 −2
Original line number Diff line number Diff line
@@ -10,8 +10,9 @@ import (
	"github.com/taironas/tinygraphs/draw"
)

// RandomGradientSVG builds an image.
func RandomGradientSVG(w http.ResponseWriter, colors, gColors []color.RGBA, gv colors.GradientVector, width, height, xsquares int) {
// RandomGradientColorSVG builds a square 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 RandomGradientColorSVG(w http.ResponseWriter, colors, gColors []color.RGBA, gv colors.GradientVector, width, height, xsquares int) {

	var gradientColors []svg.Offcolor
	gradientColors = make([]svg.Offcolor, len(gColors))