示例#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)
}
示例#2
0
文件: color.go 项目: nelsam/gxui
func (c Color) Saturate() Color {
	return Color{math.Saturate(c.R), math.Saturate(c.G), math.Saturate(c.B), math.Saturate(c.A)}
}