setasign\SetaPDF2\Core\DataStructure\Color
Rgb RGB Color
File: /SetaPDF v2/Core/DataStructure/Color/Rgb.php
Old class name (alias):
\SetaPDF_Core_DataStructure_Color_Rgb
Class hierarchy
Implements
Summary
Properties
$_components
protected \SetaPDF_Core_Type_Array AbstractColor::$_components
The array of color components
Static Methods
createByComponents()
public static AbstractColor::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
writePdfString()
public static Rgb::writePdfString (
\SetaPDF_Core_WriteInterface $writer,
array|float $componentsOrR,
bool|float $strokingOrG = 0.0,
float $b = 0.0,
bool $stroking = true
): voidarray|float $componentsOrR,
bool|float $strokingOrG = 0.0,
float $b = 0.0,
bool $stroking = true
Writes a color definition directly to a writer.
Parameters
- $writer : \SetaPDF_Core_WriteInterface
- $componentsOrR : array|float
An array of 3 components or the value for the red component
- $strokingOrG : bool|float
Stroking flag or the value for the green component
- $b : float
The value for the blue component
- $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()
public Rgb::__construct ()
The constructor.
Parameters
- $componentsOrR : \SetaPDF_Core_Type_Array|array|float
- $g : float
- $b : float
Exceptions
Throws \InvalidArgumentException