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.
427 428 429 |
# File 'lib/hexapdf/content/color_space.rb', line 427 def initialize(definition) @definition = definition end |
Instance Attribute Details
#definition ⇒ Object (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_color ⇒ Object
The default universal color.
432 433 434 |
# File 'lib/hexapdf/content/color_space.rb', line 432 def default_color Color.new(self) end |
#family ⇒ Object
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 |