Class: HexaPDF::Content::ColorSpace::Universal
- Inherits:
-
Object
- Object
- HexaPDF::Content::ColorSpace::Universal
- 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
-
#definition ⇒ Object
readonly
The color space definition used for creating this universal color space.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Compares this universal color space to another one by looking at their definitions.
-
#color(*args) ⇒ Object
(also: #prenormalized_color)
Creates a new universal color object.
-
#default_color ⇒ Object
The default universal color.
-
#family ⇒ Object
Returns the PDF color space family this color space belongs to.
-
#initialize(definition) ⇒ Universal
constructor
Creates the universal color space for the given color space definition.
Constructor Details
#initialize(definition) ⇒ Universal
Creates the universal color space for the given color space definition.
380 381 382 |
# File 'lib/hexapdf/content/color_space.rb', line 380 def initialize(definition) @definition = definition end |
Instance Attribute Details
#definition ⇒ Object (readonly)
The color space definition used for creating this universal color space.
377 378 379 |
# File 'lib/hexapdf/content/color_space.rb', line 377 def definition @definition end |
Instance Method Details
#==(other) ⇒ Object
Compares this universal color space to another one by looking at their definitions.
401 402 403 |
# File 'lib/hexapdf/content/color_space.rb', line 401 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.
390 391 392 |
# File 'lib/hexapdf/content/color_space.rb', line 390 def color(*args) Color.new(self, *args) end |
#default_color ⇒ Object
The default universal color.
385 386 387 |
# File 'lib/hexapdf/content/color_space.rb', line 385 def default_color Color.new(self) end |
#family ⇒ Object
Returns the PDF color space family this color space belongs to.
396 397 398 |
# File 'lib/hexapdf/content/color_space.rb', line 396 def family @definition[0] end |