Class: HexaPDF::Content::ColorSpace::DeviceGray
- Inherits:
-
Object
- Object
- HexaPDF::Content::ColorSpace::DeviceGray
- Defined in:
- lib/hexapdf/content/color_space.rb
Overview
The DeviceGray color space.
Defined Under Namespace
Classes: Color
Constant Summary collapse
- DEFAULT =
The one (and only) DeviceGray color space.
new
Class Method Summary collapse
-
.new(_definition = nil) ⇒ Object
Returns the DeviceGray color space object.
Instance Method Summary collapse
-
#color(gray) ⇒ Object
Returns the color object for the given gray component.
-
#default_color ⇒ Object
Returns the default color for the DeviceGray color space.
-
#family ⇒ Object
(also: #definition)
Returns
:DeviceGray
. -
#prenormalized_color(gray) ⇒ Object
Returns the color object for the gray component without applying value normalization.
Class Method Details
Instance Method Details
#color(gray) ⇒ Object
Returns the color object for the given gray component.
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 DeviceGray color value range of 0.0 to 1.0.
641 642 643 |
# File 'lib/hexapdf/content/color_space.rb', line 641 def color(gray) Color.new(ColorUtils.normalize_value(gray, 255)) end |
#default_color ⇒ Object
Returns the default color for the DeviceGray color space.
632 633 634 |
# File 'lib/hexapdf/content/color_space.rb', line 632 def default_color Color.new(0.0) end |
#family ⇒ Object Also known as: definition
Returns :DeviceGray
.
653 654 655 |
# File 'lib/hexapdf/content/color_space.rb', line 653 def family :DeviceGray end |