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.



124
125
126
# File 'lib/hexapdf/content/color_space.rb', line 124

def initialize(definition)
  @definition = definition
end

Instance Attribute Details

#definitionObject (readonly)

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



121
122
123
# File 'lib/hexapdf/content/color_space.rb', line 121

def definition
  @definition
end

Instance Method Details

#==(other) ⇒ Object

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



144
145
146
# File 'lib/hexapdf/content/color_space.rb', line 144

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

#color(*args) ⇒ Object

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



134
135
136
# File 'lib/hexapdf/content/color_space.rb', line 134

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

#default_colorObject

The default universal color.



129
130
131
# File 'lib/hexapdf/content/color_space.rb', line 129

def default_color
  Color.new(self)
end

#familyObject

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



139
140
141
# File 'lib/hexapdf/content/color_space.rb', line 139

def family
  @definition[0]
end