widget/material: better disabled color calculation

Use desaturation in combination with alpha multiplication.

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
Egon Elbre
2020-12-16 19:06:24 +02:00
committed by Elias Naur
parent 9cc90d9695
commit e383e6d6be
7 changed files with 40 additions and 7 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ func (c *checkable) layout(gtx layout.Context, checked bool) layout.Dimensions {
size := gtx.Px(c.Size)
icon.Color = c.IconColor
if gtx.Queue == nil {
icon.Color = f32color.MulAlpha(icon.Color, 150)
icon.Color = f32color.Disabled(icon.Color)
}
icon.Layout(gtx, unit.Px(float32(size)))
return layout.Dimensions{