class HexaPDF::Content::ColorSpace::DeviceRGB::Color

A color in the DeviceRGB color space.

See: PDF1.7 s8.6.4.3

Public Class Methods

new(r, g, b) click to toggle source

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.

# File lib/hexapdf/content/color_space.rb, line 279
def initialize(r, g, b)
  @r = r
  @g = g
  @b = b
end

Public Instance Methods

color_space() click to toggle source

Returns the DeviceRGB color space module.

# File lib/hexapdf/content/color_space.rb, line 286
def color_space
  DeviceRGB::DEFAULT
end
components() click to toggle source

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

# File lib/hexapdf/content/color_space.rb, line 291
def components
  [@r, @g, @b]
end