Example #1
0
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)
}
Example #2
0
File: color.go Project: 4ydx/gxui
func (c Color) Saturate() Color {
	return Color{math.Saturate(c.R), math.Saturate(c.G), math.Saturate(c.B), math.Saturate(c.A)}
}