Class: HexaPDF::Content::ColorSpace::Universal

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

Overview

This class represents a “universal” color space that is used for all color spaces that aren’t implemented yet.

Defined Under Namespace

Classes: Color

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(definition) ⇒ Universal

Creates the universal color space for the given color space definition.



427
428
429
# File 'lib/hexapdf/content/color_space.rb', line 427

def initialize(definition)
  @definition = definition
end

Instance Attribute Details

#definitionObject (readonly)

The color space definition used for creating this universal color space.



424
425
426
# File 'lib/hexapdf/content/color_space.rb', line 424

def definition
  @definition
end

Instance Method Details

#==(other) ⇒ Object

Compares this universal color space to another one by looking at their definitions.



448
449
450
# File 'lib/hexapdf/content/color_space.rb', line 448

def ==(other)
  other.kind_of?(self.class) && definition == other.definition
end

#color(*args) ⇒ Object Also known as: prenormalized_color

Creates a new universal color object. The number of arguments isn’t restricted.



437
438
439
# File 'lib/hexapdf/content/color_space.rb', line 437

def color(*args)
  Color.new(self, *args)
end

#default_colorObject

The default universal color.



432
433
434
# File 'lib/hexapdf/content/color_space.rb', line 432

def default_color
  Color.new(self)
end

#familyObject

Returns the PDF color space family this color space belongs to.



443
444
445
# File 'lib/hexapdf/content/color_space.rb', line 443

def family
  @definition[0]
end