Class: HexaPDF::Content::ColorSpace::DeviceCMYK::Color

Inherits:
Object
  • Object
show all
Includes:
ColorUtils
Defined in:
lib/hexapdf/content/color_space.rb

Overview

A color in the DeviceCMYK color space.

See: PDF2.0 s8.6.4.4

Instance Method Summary collapse

Methods included from ColorUtils

#==, normalize_value

Constructor Details

#initialize(c, m, y, k) ⇒ Color

Initializes the color with the c (cyan), m (magenta), y (yellow) and k (black) components.

Each argument has to be a float between 0.0 and 1.0.



599
600
601
602
603
604
# File 'lib/hexapdf/content/color_space.rb', line 599

def initialize(c, m, y, k)
  @c = c
  @m = m
  @y = y
  @k = k
end

Instance Method Details

#color_spaceObject

Returns the DeviceCMYK color space module.



607
608
609
# File 'lib/hexapdf/content/color_space.rb', line 607

def color_space
  DeviceCMYK::DEFAULT
end

#componentsObject

Returns the CMYK color as an array of normalized color values.



612
613
614
# File 'lib/hexapdf/content/color_space.rb', line 612

def components
  [@c, @m, @y, @k]
end