holy shit components are rendering whaaaaaaaaaaaaaaaat
This commit was merged in pull request #4.
This commit is contained in:
23
common/elements/v1/blocks/options.go
Normal file
23
common/elements/v1/blocks/options.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package blocks
|
||||
|
||||
import "image/color"
|
||||
|
||||
type Option func(*Block)
|
||||
|
||||
func Size(w, h float64) Option {
|
||||
return func(b *Block) {
|
||||
b.width, b.height = w, h
|
||||
}
|
||||
}
|
||||
|
||||
func BackgroundColor(c color.Color) Option {
|
||||
return func(b *Block) {
|
||||
b.backgroundColor = &c
|
||||
}
|
||||
}
|
||||
|
||||
func Name(n string) Option {
|
||||
return func(b *Block) {
|
||||
b.name = n
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user