summaryrefslogtreecommitdiff
path: root/internal/colors/cmyk.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/colors/cmyk.go')
-rw-r--r--internal/colors/cmyk.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/colors/cmyk.go b/internal/colors/cmyk.go
index 3460c4e..b5ef223 100644
--- a/internal/colors/cmyk.go
+++ b/internal/colors/cmyk.go
@@ -1,6 +1,9 @@
package colors
-import "math"
+import (
+ "fmt"
+ "math"
+)
type CMYK struct {
C int // 0-100
@@ -9,6 +12,10 @@ type CMYK struct {
K int // 0-100
}
+func (c CMYK) String() string {
+ return fmt.Sprintf("cmyk(%d, %d, %d, %d)", c.C, c.M, c.Y, c.K)
+}
+
func (c CMYK) ToPrecise() PreciseColor {
return PreciseColor{
R: (1 - float64(c.C)/100) * (1 - float64(c.K)/100),