func (b *ProgressBar) Paint(c gxui.Canvas) { frac := math.Saturate(float32(b.progress) / float32(b.target)) r := b.outer.Size().Rect() b.PaintBackground(c, r) b.outer.PaintProgress(c, r, frac) b.PaintBorder(c, r) }
func (c Color) Saturate() Color { return Color{math.Saturate(c.R), math.Saturate(c.G), math.Saturate(c.B), math.Saturate(c.A)} }