Files
games/common/elements/v1/base/config.go
2025-09-05 21:21:18 -04:00

30 lines
487 B
Go

package base
import (
"image/color"
"git.vezzani.net/ben/games/common/elements/v1"
)
type OptFunc func(*Element)
func Children(children ...elements.Element) OptFunc {
return func(c *Element) {
c.children = children
}
}
func Name(name string) OptFunc {
return func(s *Element) {
s.name = name
}
}
func (b elements.Builder) BackgroundColor(c color.Color) elements.Builder {
return func() elements.Element {
ce := b().(*Element)
ce.backgroundColor = c
return ce
}
}