~mendelmaleh/dummy

b55e2ddbfb4fcce5f19f65cbc152a3611ed89e1d — Mendel E 4 years ago 7f35660
Add plain pattern, set it as default
2 files changed, 4 insertions(+), 1 deletions(-)

M image.go
M options.go
M image.go => image.go +3 -0
@@ 3,6 3,7 @@ package main
import (
	"image"
	"image/color"
	"image/draw"
)

type img struct {


@@ 13,6 14,8 @@ func Image(opt Options) image.Image {
	im := img{image.NewRGBA(image.Rectangle{image.Point{}, image.Point{opt.Width, opt.Height}})}

	switch opt.Pattern {
	case "plain":
		draw.Draw(im, im.Bounds(), image.NewUniform(opt.Colors[0]), image.Point{}, draw.Src)
	case "diagonal":
		var c [2]color.RGBA
		copy(c[:], opt.Colors)

M options.go => options.go +1 -1
@@ 21,7 21,7 @@ var dopt = &Options{
	// image
	Width:   200,
	Height:  200,
	Pattern: "diagonal",
	Pattern: "plain",
	Colors: []color.RGBA{
		color.RGBA{0x24, 0x29, 0x33, 0xff},
		color.RGBA{0xec, 0xef, 0xf4, 0xff},