setasign\SetaPDF2\Core\DataStructure\Color
Gray Gray Color
File: /SetaPDF v2/Core/DataStructure/Color/Gray.php
Old class name (alias):
\SetaPDF_Core_DataStructure_Color_Gray
Class hierarchy
Implements
Summary
Properties
$_components
The array of color components
Static Methods
createByComponents()
Create an instance by a PDF array object, PHP array or a hexadecimal string of an RGB value.
Parameters
- $components : int|float|string|array|\SetaPDF_Core_Type_Array
Exceptions
Throws \InvalidArgumentException
hexToRgb()
WARNING: This method is marked as deprecated!
Use Rgb::hexToRgb() instead.
Converts a hex encoded string (3 or 6 characters) into a component array of red, green and blue values.
Parameters
- $hex : string
writePdfString()
Writes a color definition directly to a writer.
Parameters
- $writer : \SetaPDF_Core_WriteInterface
- $components : array|float
An array of 1 component or the value for the gray color
- $stroking : bool
Stroking flag
Exceptions
Throws \InvalidArgumentException
writePdfStringByComponents()
Writes a color definition directly to a writer.
Parameters
- $writer : \SetaPDF_Core_WriteInterface
- $components : array|int|float|string
- $stroking : bool
Exceptions
Throws \InvalidArgumentException
Methods
__construct()
The constructor.
Parameters
- $components : float|\SetaPDF_Core_Type_Array
Exceptions
Throws \InvalidArgumentException