Files
realworld/inc/theme.manager.go
T
mr.zeroandClaude Opus 5 07312f0f29
ci/woodpecker/push/ebitengine Pipeline was successful
Drop the duplicate Manager, use inkwell's
The engine already had the registry the game was reimplementing:
inkwell.Manager[T Named], and every entity type here is an alias of an
engine struct, so they all carry GetName() already. manager.manager.go
and manager.interface.go are gone; a category manager is now one call to
inkwell.NewManager.

registerAll goes with it — Each does the hand-off — and the selector
writes its derived pins back with Set, which keeps the scene in place in
the registration order.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30 09:51:17 +02:00

39 lines
581 B
Go

package inc
import (
"image/color"
inkwell "git.teletypegames.org/engines/inkwell"
)
type Theme = inkwell.Theme
var ThemeManager = inkwell.NewManager[Theme]()
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() {
ThemeManager.Each(World.G.ThemeManager.Register)
}