summaryrefslogtreecommitdiff
path: root/internal/colors/rgb.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/colors/rgb.go')
-rw-r--r--internal/colors/rgb.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/colors/rgb.go b/internal/colors/rgb.go
index e81aefc..0cc48da 100644
--- a/internal/colors/rgb.go
+++ b/internal/colors/rgb.go
@@ -1,6 +1,9 @@
package colors
-import "math"
+import (
+ "fmt"
+ "math"
+)
type RGB struct {
R int // 0-255
@@ -8,6 +11,10 @@ type RGB struct {
B int // 0-255
}
+func (c RGB) String() string {
+ return fmt.Sprintf("rgb(%d, %d, %d)", c.R, c.G, c.B)
+}
+
func (c RGB) ToPrecise() PreciseColor {
return PreciseColor{
R: float64(c.R) / 255,