Apply go fix modernizations

This commit is contained in:
Ian Gulliver
2026-03-05 11:39:13 -08:00
parent 165b9d1c6c
commit fc3bbf894f
6 changed files with 32 additions and 36 deletions

View File

@@ -98,7 +98,7 @@ func main() {
draw.Draw(img, img.Bounds(), &image.Uniform{bg}, image.Point{}, draw.Src)
charW := font.MeasureString(stripFont, "0").Ceil()
pad := 8
for e := 0; e < count; e++ {
for e := range count {
ci := p.Start + e
ch := channels[ci]
cc := ch.Color
@@ -107,10 +107,7 @@ func main() {
valStr := fmt.Sprintf("%03d %02x", ch.Value, ch.Value)
nameW := font.MeasureString(stripFont, ch.Name).Ceil()
valW := font.MeasureString(stripFont, valStr).Ceil()
textW := nameW
if valW > textW {
textW = valW
}
textW := max(valW, nameW)
x0 := mid - textW/2 - pad
x1 := mid + textW/2 + pad
@@ -155,8 +152,8 @@ func main() {
if i == page {
img := image.NewRGBA(image.Rect(0, 0, sz, sz))
draw.Draw(img, img.Bounds(), txt, image.Point{}, draw.Src)
for y := 0; y < sz; y++ {
for x := 0; x < sz; x++ {
for y := range sz {
for x := range sz {
if x < b || x >= sz-b || y < b || y >= sz-b {
img.Set(x, y, color.RGBA{255, 255, 255, 255})
}