SetaPDF_Core_DataStructure_Color_Special Special Color

File: /SetaPDF v2/Core/DataStructure/Color/Special.php

Special colors are used in Pattern, Separation, DeviceN and ICCBased colour spaces.

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()

public static SetaPDF_Core_DataStructure_Color::hexToRgb (
string $hex
): array

Converts a hex encoded string (3 or 6 characters) into a component array of red, green and blue values.

Parameters
$hex : string
 

writePdfString()

public static SetaPDF_Core_DataStructure_Color_Special::writePdfString (
SetaPDF_Core_WriteInterface $writer, array|float $components [, boolean $stroking = true ]
): void

Writes a color definition directly to a writer.

Parameters
$writer : SetaPDF_Core_WriteInterface
 
$components : array|float
 
$stroking : boolean

Stroking flag

Exceptions

Throws InvalidArgumentException

writePdfStringByComponents()

public static SetaPDF_Core_DataStructure_Color::writePdfStringByComponents (
SetaPDF_Core_WriteInterface $writer, array|int|float|string $components [, bool $stroking = true ]
): void

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|array|SetaPDF_Core_Type_Array
 
Exceptions

Throws InvalidArgumentException

__clone()

Implementation of __clone().

adjustAllComponents()

Adjust all color components by a specific value.

Parameters
$by : int|float
 

draw()

public SetaPDF_Core_DataStructure_Color_Special::draw (
SetaPDF_Core_WriteInterface $writer [, boolean $stroking = true ]
): void

Draw the color on a writer.

Parameters
$writer : SetaPDF_Core_WriteInterface
 
$stroking : boolean
 
See

getValue()

Get the components of the color.

toPhp()

public SetaPDF_Core_DataStructure_Color::toPhp (
void
): array

Get the data as a PHP value.