class HexaPDF::Content::ColorSpace::DeviceRGB

The DeviceRGB color space.

Constants

DEFAULT

The one (and only) DeviceRGB color space.

Public Class Methods

new(_definition = nil) click to toggle source

Returns the DeviceRGB color space object.

# File lib/hexapdf/content/color_space.rb, line 235
def self.new(_definition = nil)
  DEFAULT
end

Public Instance Methods

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

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

Color values can either be integers in the range from 0 to 255 or floating point numbers between 0.0 and 1.0. The integer color values are automatically normalized to the DeviceRGB color value range of 0.0 to 1.0.

# File lib/hexapdf/content/color_space.rb, line 249
def color(r, g, b)
  Color.new(ColorUtils.normalize_value(r, 255),
            ColorUtils.normalize_value(g, 255),
            ColorUtils.normalize_value(b, 255))
end
default_color() click to toggle source

Returns the default color for the DeviceRGB color space.

# File lib/hexapdf/content/color_space.rb, line 240
def default_color
  Color.new(0.0, 0.0, 0.0)
end
definition()
Alias for: family
family() click to toggle source

Returns :DeviceRGB.

# File lib/hexapdf/content/color_space.rb, line 264
def family
  :DeviceRGB
end
Also aliased as: definition
prenormalized_color(r, g, b) click to toggle source

Returns the color object for the red, green and blue components without applying value normalization.

See: color

# File lib/hexapdf/content/color_space.rb, line 259
def prenormalized_color(r, g, b)
  Color.new(r, g, b)
end