widget/material: manage widget colors with Palette type

This introduces a new material.Palette type that captures the color information
necessary to render a widget. This type is embedded in the material.Theme to
make it easier to swap to a different palette for part of the UI by reassinging
the Palette field.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
This commit is contained in:
Chris Waldon
2020-12-05 21:59:49 -05:00
committed by Elias Naur
parent 47ba975899
commit a87a520ae8
10 changed files with 57 additions and 35 deletions
+2 -2
View File
@@ -32,10 +32,10 @@ func Editor(th *Theme, editor *widget.Editor, hint string) EditorStyle {
return EditorStyle{
Editor: editor,
TextSize: th.TextSize,
Color: th.Color.Text,
Color: th.Palette.Fg,
shaper: th.Shaper,
Hint: hint,
HintColor: th.Color.Hint,
HintColor: f32color.MulAlpha(th.Palette.Fg, 0xbb),
}
}