summaryrefslogtreecommitdiff
path: root/status/00-status.go
diff options
context:
space:
mode:
Diffstat (limited to 'status/00-status.go')
-rw-r--r--status/00-status.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/status/00-status.go b/status/00-status.go
index 809297b..6fcaf33 100644
--- a/status/00-status.go
+++ b/status/00-status.go
@@ -91,6 +91,10 @@ func blendGYR(percent int) color.Color {
return drw.Blend3(config.Green, config.Yellow, config.Red, percent)
}
+func blendBg(c color.Color) color.Color {
+ return drw.Blend(c, config.Status, 75)
+}
+
func (s *status) furthest(x int) {
if x > s.W {
s.W = x
@@ -107,3 +111,16 @@ func (s *status) drawRect(x, y, w, h int, c color.Color, fill bool) {
drw.DrawRect(s.I, x, y, w, h, c, fill)
s.furthest(x + w)
}
+
+func (s *status) drawPercentBar(x, percent int) int {
+ tbpad := 3
+ th := int(config.H) - tbpad * 2 + 1
+ h := int(th * percent / 100)
+ fg := blendGYR(percent)
+ bg := blendBg(fg)
+
+ s.drawRect(x, tbpad - 1, 3, th, bg, true)
+ s.drawRect(x, tbpad + th - h - 1, 3, h, fg, true)
+
+ return 5
+}