This repository has been archived on 2024-05-03. You can view files and clone it, but cannot push or open issues or pull requests.
wintergreen/theme.go

38 lines
1004 B
Go
Raw Normal View History

2023-08-08 00:07:01 -06:00
package wintergreen
import "git.tebibyte.media/tomo/tomo"
import "golang.org/x/image/font/basicfont"
import "git.tebibyte.media/tomo/tomo/theme"
var colorFocus = color.RGBA { R: 61, G: 128, B: 143, A: 255 }
var colorInput = color.RGBA { R: 208, G: 203, B: 150, A: 255 }
var colorCarved = color.RGBA { R: 169, G: 171, B: 168, A: 255 }
var colorBackground = color.RGBA { R: 169, G: 171, B: 168, A: 255 }
var colorForeground = color.Black
var colorOutline = color.Black
var outline = tomo.Border {
Width: tomo.I(1),
Color: [4]color.Color {
colorOutline,
colorOutline,
colorOutline,
colorOutline,
},
}
type Theme struct { }
func (Theme) Apply (object tomo.Object, role theme.Role) {
if textBox, ok := object.(tomo.TextBox); ok {
textBox.SetDotColor(colorFocus)
textBox.SetTextColor(colorForeground)
}
switch role.Object {
case "Button": object.SetColor(colorCarved)
case "Input": object.SetColor(colorInput)
default: object.SetColor(colorBackground)
}
}