Class: HexaPDF::Content::ColorSpace::DeviceGray::Color

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

Overview

A color in the DeviceGray color space.

See: PDF2.0 s8.6.4.2

Instance Method Summary collapse

Methods included from ColorUtils

#==, normalize_value

Constructor Details

#initialize(gray) ⇒ Color

Initializes the color with the gray component.

The argument gray has to be a float between 0.0 and 1.0.



668
669
670
# File 'lib/hexapdf/content/color_space.rb', line 668

def initialize(gray)
  @gray = gray
end

Instance Method Details

#color_spaceObject

Returns the DeviceGray color space module.



673
674
675
# File 'lib/hexapdf/content/color_space.rb', line 673

def color_space
  DeviceGray::DEFAULT
end

#componentsObject

Returns the normalized gray value as an array.



678
679
680
# File 'lib/hexapdf/content/color_space.rb', line 678

def components
  [@gray]
end