From 2af3490a79b5199e14c19d65d7edad3cfdb8e183 Mon Sep 17 00:00:00 2001 From: itchyny Date: Sat, 23 Mar 2024 11:06:25 +0900 Subject: [PATCH] change solution color of images to blue for consistency --- maze.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/maze.go b/maze.go index e9ea1db..15ad2a4 100644 --- a/maze.go +++ b/maze.go @@ -371,9 +371,6 @@ func (maze *Maze) PrintPNG(writer io.Writer, scale int) { width := len(lines[0]) / 2 height := len(lines) img := image.NewRGBA(image.Rect(0, 0, width*scale, height*scale)) - red, green, yellow := color.RGBA{255, 0, 0, 255}, - color.RGBA{0, 255, 0, 255}, - color.RGBA{255, 255, 0, 255} for y := 0; y < height; y++ { if y >= len(lines) { continue @@ -386,11 +383,11 @@ func (maze *Maze) PrintPNG(writer io.Writer, scale int) { case "##": plot(img, x, y, scale, color.Black) case "::": - plot(img, x, y, scale, yellow) + plot(img, x, y, scale, color.RGBA{0, 0, 255, 255}) case "S ", " S", "S:", ":S": - plot(img, x, y, scale, red) + plot(img, x, y, scale, color.RGBA{255, 0, 0, 255}) case "G ", " G", "G:", ":G": - plot(img, x, y, scale, green) + plot(img, x, y, scale, color.RGBA{0, 255, 0, 255}) default: plot(img, x, y, scale, color.White) } @@ -423,7 +420,7 @@ func (maze *Maze) PrintSVG(writer io.Writer, scale int) { case "##": fmt.Fprintf(writer, ``+"\n", x*scale, y*scale, scale, scale) case "::": - fmt.Fprintf(writer, ``+"\n", x*scale, y*scale, scale, scale) + fmt.Fprintf(writer, ``+"\n", x*scale, y*scale, scale, scale) case "S ", " S", "S:", ":S": fmt.Fprintf(writer, ``+"\n", x*scale, y*scale, scale, scale) case "G ", " G", "G:", ":G":