From b55e2ddbfb4fcce5f19f65cbc152a3611ed89e1d Mon Sep 17 00:00:00 2001 From: Mendel E Date: Thu, 7 May 2020 11:37:10 -0400 Subject: [PATCH] Add plain pattern, set it as default --- image.go | 3 +++ options.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/image.go b/image.go index e254da6..bb39957 100644 --- a/image.go +++ b/image.go @@ -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) diff --git a/options.go b/options.go index acfa39c..117673d 100644 --- a/options.go +++ b/options.go @@ -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}, -- 2.38.5