From c952a096a161e991a54a569b71c7bb773b583eb3 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Sat, 20 Jan 2024 18:03:39 -0500 Subject: use variable rather than function for color constant --- ui.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'ui.go') diff --git a/ui.go b/ui.go index 28692d6..f132dd1 100644 --- a/ui.go +++ b/ui.go @@ -9,9 +9,7 @@ import ( "strconv" ) -func red() color.RGBA { - return color.RGBA{255, 0, 0, 255} -} +var red = color.RGBA{255, 0, 0, 255} func displacementRow() *g.RowWidget { s := VolumeUnits[volumeUnitIndex] @@ -303,7 +301,7 @@ func updateCompImg() { ps := img.Bounds().Dx() / 100 // Point size draw.Draw(img, image.Rect(pos.X-ps/2, pos.Y-ps/2, pos.X+ps/2, pos.Y+ps/2), - &image.Uniform{red()}, + &image.Uniform{red}, image.ZP, draw.Src, ) -- cgit v1.2.3