diff options
author | Kurt <kurt.w.jung@gmail.com> | 2017-11-12 14:04:27 -0500 |
---|---|---|
committer | Kurt <kurt.w.jung@gmail.com> | 2017-11-12 14:04:27 -0500 |
commit | 7751c17f106d9d7d4c6c290b969ece1c8dab4371 (patch) | |
tree | fc51f6814469f13161138cda99442c95c91c78ec /def.go | |
parent | 5e5bb8c2a2d6d41c3d0ef93f5d6181e7f1070a33 (diff) |
Add partial support for spot colors. This does not yet include gradients, etc
Diffstat (limited to 'def.go')
-rw-r--r-- | def.go | 31 |
1 files changed, 30 insertions, 1 deletions
@@ -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 { |