diff --git a/ui/button.go b/ui/button.go index efe6273..735f091 100644 --- a/ui/button.go +++ b/ui/button.go @@ -73,10 +73,10 @@ func (b *Button) fillColor(p *Palette) color.Color { if b.over { switch b.Type { case ButtonTypeContained: - return p.PrimaryHighlight + return p.PrimaryLight case ButtonTypeIcon: default: - return p.PrimaryLight + return p.PrimaryHighlight } } switch b.Type { diff --git a/ui/scrollbar.go b/ui/scrollbar.go index b7cef16..c634719 100644 --- a/ui/scrollbar.go +++ b/ui/scrollbar.go @@ -85,7 +85,7 @@ func (h *ScrollbarHandle) Render(ctx Context) { p := ctx.Style().Palette fill := p.Primary if h.over { - fill = p.PrimaryHighlight + fill = p.PrimaryLight } ctx.Renderer().FillRectangle(h.bounds.Inset(1), fill) } diff --git a/ui/style.go b/ui/style.go index 8548ca3..a861670 100644 --- a/ui/style.go +++ b/ui/style.go @@ -21,7 +21,9 @@ type Palette struct { Background color.Color // Primary is used as a the main contrast color. Primary color.Color - // PrimaryHighlight is a highlighted version of the main contrast color. + // PrimaryDark is a foreground version of the main contrast color. + PrimaryDark color.Color + // PrimaryHighlight is a light version of the main contrast color. PrimaryHighlight color.Color // PrimaryLight is a background version of the main contrast color. PrimaryLight color.Color @@ -65,8 +67,9 @@ func DefaultPalette() *Palette { defaultPalette = &Palette{ Background: color.White, Primary: RGBA(0x3F, 0x51, 0xB5, 0xFF), - PrimaryHighlight: RGBA(0x5C, 0x6B, 0xC0, 0xFF), - PrimaryLight: RGBA(0xE8, 0xEA, 0xF6, 0xFF), + PrimaryDark: RGBA(0x00, 0x28, 0x84, 0xFF), + PrimaryHighlight: RGBA(0xE8, 0xEA, 0xF6, 0xFF), + PrimaryLight: RGBA(0x75, 0x7C, 0xE8, 0xFF), ShadedBackground: RGBA(0xFA, 0xFA, 0xFA, 0xFF), Text: color.Black, TextDisabled: RGBA(0xBD, 0xBD, 0xBD, 0xFF), diff --git a/ui/textbox.go b/ui/textbox.go index f2e370c..db23d23 100644 --- a/ui/textbox.go +++ b/ui/textbox.go @@ -233,7 +233,7 @@ func (b *TextBox) Render(ctx Context) { renderer.Clear(color.Transparent) if b.Selection.Start != b.Selection.End { left, right := renderer.Font(f).WidthOf(b.Text[:b.Selection.Start]), renderer.Font(f).WidthOf(b.Text[:b.Selection.End]) - renderer.FillRectangle(geom.RectF32(left, 0, right, size.Y), style.Palette.PrimaryLight) + renderer.FillRectangle(geom.RectF32(left, 0, right, size.Y), style.Palette.PrimaryHighlight) } renderer.Text(geom.ZeroPtF32, f, c, b.Text) const interval = 500 * time.Millisecond