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
+2 -2
View File
@@ -129,7 +129,7 @@ func (b ButtonLayoutStyle) Layout(gtx layout.Context, w layout.Widget) layout.Di
}}, rr).Add(gtx.Ops)
background := b.Background
if gtx.Queue == nil {
background = f32color.MulAlpha(b.Background, 150)
background = f32color.Disabled(b.Background)
}
paint.Fill(gtx.Ops, background)
for _, c := range b.Button.History() {
@@ -156,7 +156,7 @@ func (b IconButtonStyle) Layout(gtx layout.Context) layout.Dimensions {
}, rr).Add(gtx.Ops)
background := b.Background
if gtx.Queue == nil {
background = f32color.MulAlpha(b.Background, 150)
background = f32color.Disabled(b.Background)
}
paint.Fill(gtx.Ops, background)
for _, c := range b.Button.History() {