@@ 10,26 10,26 @@ type img struct {
}
func Image(opt Options) image.Image {
- m := img{image.NewRGBA(image.Rectangle{image.Point{}, image.Point{opt.Width, opt.Height}})}
+ im := img{image.NewRGBA(image.Rectangle{image.Point{}, image.Point{opt.Width, opt.Height}})}
switch opt.Pattern {
case "diagonal":
var c [2]color.RGBA
copy(c[:], opt.Colors)
- m.drawDiagonal(opt.Width, opt.Height, c)
+ im.drawDiagonal(opt.Width, opt.Height, c)
}
- return m
+ return im
}
-func (m *img) drawDiagonal(w, h int, c [2]color.RGBA) {
+func (im *img) drawDiagonal(w, h int, c [2]color.RGBA) {
for x := 0; x < w; x++ {
for y := 0; y < h; y++ {
// if y < h/w)*x) {
if y <= h-x {
- m.Set(x, y, c[0])
+ im.Set(x, y, c[0])
} else {
- m.Set(x, y, c[1])
+ im.Set(x, y, c[1])
}
}
}
@@ 75,8 75,8 @@ func Dummy(w http.ResponseWriter, r *http.Request, opt Options) {
// apply limits and hacks
opt.Normalize()
- img := Image(opt)
- png.Encode(w, img)
+ im := Image(opt)
+ png.Encode(w, im)
// fmt.Fprintf(w, "%+v\n", dopt)
}