summaryrefslogtreecommitdiff
path: root/bar
diff options
context:
space:
mode:
authorhhvn <dev@hhvn.uk>2023-11-19 13:49:28 +0000
committerhhvn <dev@hhvn.uk>2023-11-19 13:49:28 +0000
commit4722a069233b35efd0b600c973e7a7e9bca01d16 (patch)
treee7caa92c65932651e81b201edfcf704886aa2660 /bar
parent1c46de9342a93cf8284d2bd4ed58f524cda60b29 (diff)
Do int2rgb conversions once. In config.go.
Diffstat (limited to 'bar')
-rw-r--r--bar/bar.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/bar/bar.go b/bar/bar.go
index c10732d..cc76d31 100644
--- a/bar/bar.go
+++ b/bar/bar.go
@@ -5,6 +5,7 @@ import (
"sync"
"image"
"errors"
+ "image/color"
"hhvn.uk/hbspbar/config"
"hhvn.uk/hbspbar/common"
@@ -42,16 +43,16 @@ func (b *bar) rect() image.Rectangle {
return image.Rect(0, 0, int(b.Mon.Rectangle.Width), int(config.H))
}
-func (b *bar) drawText(x int, col uint32, text string) (int, error) {
+func (b *bar) drawText(x int, col color.Color, text string) (int, error) {
return drw.DrawText(b.i, x, col, text)
}
-func (b *bar) drawRect(x, y, w, h int, c uint32, fill bool) {
+func (b *bar) drawRect(x, y, w, h int, c color.Color, fill bool) {
drw.DrawRect(b.i, x, y, w, h, c, fill)
}
func (b *bar) draw() {
- var bg uint32
+ var bg color.Color
var filled bool
b.drawing.Lock()