watchface/draw.go
2022-01-02 05:28:31 +01:00

24 lines
432 B
Go

package main
import (
"image"
"image/color"
"image/draw"
)
func Fill(img draw.Image, rect image.Rectangle, c color.Color) {
for x := rect.Min.X; x < rect.Max.X; x++ {
for y := rect.Min.Y; y < rect.Max.Y; y++ {
img.Set(x, y, c)
}
}
}
func Copy(dst, src draw.Image, rect image.Rectangle) {
for x := rect.Min.X; x < rect.Max.X; x++ {
for y := rect.Min.Y; y < rect.Max.Y; y++ {
dst.Set(x, y, src.At(x, y))
}
}
}