Class: HexaPDF::Content::ColorSpace::DeviceRGB::Color
- Inherits:
-
Object
- Object
- HexaPDF::Content::ColorSpace::DeviceRGB::Color
- Includes:
- ColorUtils
- Defined in:
- lib/hexapdf/content/color_space.rb
Overview
A color in the DeviceRGB color space.
See: PDF2.0 s8.6.4.3
Instance Method Summary collapse
-
#color_space ⇒ Object
Returns the DeviceRGB color space module.
-
#components ⇒ Object
Returns the RGB color as an array of normalized color values.
-
#initialize(r, g, b) ⇒ Color
constructor
Initializes the color with the
r
(red),g
(green) andb
(blue) components.
Methods included from ColorUtils
Constructor Details
#initialize(r, g, b) ⇒ Color
Initializes the color with the r
(red), g
(green) and b
(blue) components.
Each argument has to be a float between 0.0 and 1.0.
528 529 530 531 532 |
# File 'lib/hexapdf/content/color_space.rb', line 528 def initialize(r, g, b) @r = r @g = g @b = b end |
Instance Method Details
#color_space ⇒ Object
Returns the DeviceRGB color space module.
535 536 537 |
# File 'lib/hexapdf/content/color_space.rb', line 535 def color_space DeviceRGB::DEFAULT end |
#components ⇒ Object
Returns the RGB color as an array of normalized color values.
540 541 542 |
# File 'lib/hexapdf/content/color_space.rb', line 540 def components [@r, @g, @b] end |