From f4013e567203d89ecfb81f455a091343d45a51b8 Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Sat, 29 Feb 2020 16:09:05 -0600 Subject: [PATCH] add NamedColor type --- color.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/color.go b/color.go index 86550b7..15d6cdc 100644 --- a/color.go +++ b/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) +}