Changed palette (added PrimaryDark color and changed PrimaryHighlight and PrimaryLight colors).
This commit is contained in:
parent
3390d46f34
commit
28af8aba06
@ -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 {
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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),
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user