stone/config.go

38 lines
864 B
Go
Raw Normal View History

2022-10-31 13:51:28 -06:00
package stone
import "image/color"
2022-11-08 23:01:13 -07:00
// Config stores configuration parameters. Backends only should honor parameters
// that they can support.
2022-10-31 13:51:28 -06:00
type Config struct {
2022-11-15 09:16:29 -07:00
colors [8]color.Color
2022-10-31 13:51:28 -06:00
padding int
fontSize int
fontName string
}
2022-11-08 23:01:13 -07:00
// Color returns the color value at the specified index.
2022-10-31 13:51:28 -06:00
func (config *Config) Color (index Color) (value color.Color) {
value = config.colors[index]
return
}
2022-11-08 23:01:13 -07:00
// Padding specifies how many cell's worth of padding should be on all sides of
// the buffer.
2022-10-31 13:51:28 -06:00
func (config *Config) Padding () (padding int) {
padding = config.padding
return
}
2022-11-08 23:01:13 -07:00
// FontSize specifies how big the font should be.
2022-10-31 13:51:28 -06:00
func (config *Config) FontSize () (fontSize int) {
fontSize = config.fontSize
return
}
2022-11-08 23:01:13 -07:00
// FontName specifies the name of the font to use.
2022-10-31 13:51:28 -06:00
func (config *Config) FontName () (fontName string) {
fontName = config.fontName
return
}