Files
realworld/inc/theme.manager.go
T
2026-08-29 23:59:56 +02:00

39 lines
622 B
Go

package inc
import (
"image/color"
inkwell "git.teletypegames.org/engines/inkwell"
)
type Theme = inkwell.Theme
var ThemeManager = NewManager(func(entity Theme) string { return entity.Name })
const (
RealWorld = "realworld-93"
NokiaPunk = "nokia-punk"
)
func RGB(hex uint32) color.Color {
return color.RGBA{
R: uint8(hex >> 16),
G: uint8(hex >> 8),
B: uint8(hex),
A: 0xff,
}
}
func RGBA(hex uint32, a uint8) color.Color {
return color.RGBA{
R: uint8(hex >> 16),
G: uint8(hex >> 8),
B: uint8(hex),
A: a,
}
}
func registerTheme() {
registerAll(ThemeManager, World.G.ThemeManager.Register)
}