Class: HexaPDF::Content::ColorSpace::DeviceRGB

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

Overview

The DeviceRGB color space.

Defined Under Namespace

Classes: Color

Constant Summary collapse

DEFAULT =

The one (and only) DeviceRGB color space.

new

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new(_definition = nil) ⇒ Object

Returns the DeviceRGB color space object.



180
181
182
# File 'lib/hexapdf/content/color_space.rb', line 180

def self.new(_definition = nil)
  DEFAULT
end

Instance Method Details

#color(r, g, b) ⇒ Object

Returns the color object for the given red, green and blue components.



190
191
192
# File 'lib/hexapdf/content/color_space.rb', line 190

def color(r, g, b)
  Color.new(r, g, b)
end

#default_colorObject

Returns the default color for the DeviceRGB color space.



185
186
187
# File 'lib/hexapdf/content/color_space.rb', line 185

def default_color
  Color.new(0.0, 0.0, 0.0)
end

#familyObject

Returns :DeviceRGB.



195
196
197
# File 'lib/hexapdf/content/color_space.rb', line 195

def family
  :DeviceRGB
end