38 lines
864 B
Go
38 lines
864 B
Go
package stone
|
|
|
|
import "image/color"
|
|
|
|
// Config stores configuration parameters. Backends only should honor parameters
|
|
// that they can support.
|
|
type Config struct {
|
|
colors [8]color.Color
|
|
padding int
|
|
fontSize int
|
|
fontName string
|
|
}
|
|
|
|
// Color returns the color value at the specified index.
|
|
func (config *Config) Color (index Color) (value color.Color) {
|
|
value = config.colors[index]
|
|
return
|
|
}
|
|
|
|
// Padding specifies how many cell's worth of padding should be on all sides of
|
|
// the buffer.
|
|
func (config *Config) Padding () (padding int) {
|
|
padding = config.padding
|
|
return
|
|
}
|
|
|
|
// FontSize specifies how big the font should be.
|
|
func (config *Config) FontSize () (fontSize int) {
|
|
fontSize = config.fontSize
|
|
return
|
|
}
|
|
|
|
// FontName specifies the name of the font to use.
|
|
func (config *Config) FontName () (fontName string) {
|
|
fontName = config.fontName
|
|
return
|
|
}
|