add NamedColor type
This commit is contained in:
6
color.go
6
color.go
@ -20,6 +20,8 @@ type (
|
||||
H, K int16
|
||||
S, B float32
|
||||
}
|
||||
|
||||
NamedColor string
|
||||
)
|
||||
|
||||
func NewRGBColor(r, g, b uint8) (*RGBColor, error) {
|
||||
@ -60,3 +62,7 @@ func (c HSBKColor) ColorString() string {
|
||||
func (c HSBKColor) MarshalText() ([]byte, error) {
|
||||
return []byte(c.ColorString()), nil
|
||||
}
|
||||
|
||||
func (c NamedColor) ColorString() string {
|
||||
return string(c)
|
||||
}
|
||||
|
Reference in New Issue
Block a user