SetaPDF_Core_DataStructure_Color Abstract class for color structures
File: /SetaPDF v2/Core/DataStructure/Color.php
Class hierarchy
Summary
Properties
Static Methods
createByComponents()
public static SetaPDF_Core_DataStructure_Color::createByComponents (
int|float|string|array|SetaPDF_Core_Type_Array $components
): SetaPDF_Core_DataStructure_ColorCreate 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()
Converts a hex encoded string (3 or 6 characters) into a component array of red, green and blue values.
Parameters
- $hex : string
writePdfString()
Writes the colors components to a writer.
Parameters
- $writer : SetaPDF_Core_WriteInterface
- $components : array
- $stroking : boolean|null
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()
public SetaPDF_Core_DataStructure_Color::__construct (
SetaPDF_Core_Type_Array|array|float $components
)The constructor.
Parameters
- $components : SetaPDF_Core_Type_Array|array|float
draw()
public SetaPDF_Core_DataStructure_Color::draw (
SetaPDF_Core_WriteInterface $writer [, boolean $stroking = true ]
): voidWrite the color as a PDF string to a writer.
Parameters
- $writer : SetaPDF_Core_WriteInterface
- $stroking : boolean