summaryrefslogtreecommitdiff
path: root/def.go
diff options
context:
space:
mode:
authorKurt <kurt.w.jung@gmail.com>2017-11-12 14:04:27 -0500
committerKurt <kurt.w.jung@gmail.com>2017-11-12 14:04:27 -0500
commit7751c17f106d9d7d4c6c290b969ece1c8dab4371 (patch)
treefc51f6814469f13161138cda99442c95c91c78ec /def.go
parent5e5bb8c2a2d6d41c3d0ef93f5d6181e7f1070a33 (diff)
Add partial support for spot colors. This does not yet include gradients, etc
Diffstat (limited to 'def.go')
-rw-r--r--def.go31
1 files changed, 30 insertions, 1 deletions
diff --git a/def.go b/def.go
index fd6ef81..88e4dea 100644
--- a/def.go
+++ b/def.go
@@ -39,6 +39,34 @@ type gradientType struct {
objNum int
}
+type colorMode int
+
+const (
+ colorModeRGB colorMode = iota
+ colorModeSpot
+ colorModeCMYK
+)
+
+type colorType struct {
+ r, g, b float64
+ ir, ig, ib int
+ mode colorMode
+ spotStr string // name of current spot color
+ gray bool
+ str string
+}
+
+// SpotColorType specifies a named spot color value
+type spotColorType struct {
+ id, objID int
+ val cmykColorType
+}
+
+// CMYKColorType specifies an ink-based CMYK color value
+type cmykColorType struct {
+ c, m, y, k byte // 0% to 100%
+}
+
// SizeType fields Wd and Ht specify the horizontal and vertical extents of a
// document element such as a page.
type SizeType struct {
@@ -254,8 +282,9 @@ type Fpdf struct {
colorFlag bool // indicates whether fill and text colors are different
color struct {
// Composite values of colors
- draw, fill, text clrType
+ draw, fill, text colorType
}
+ spotColorMap map[string]spotColorType // Map of named ink-based colors
}
type encType struct {