SetaPDF_Core_DataStructure_Color_Cmyk CMYK Color

File: /SetaPDF/Core/DataStructure/Color/Cmyk.php

Class hierarchy

Implements

Summary

Properties

$_components


Static Methods

createByComponents()

Create an instance by a PDF array object, PHP array or a hexadecimal string of an RGB value.

Parameters
$components : bool|int|float|string|array|SetaPDF_Core_Type_Array

The count of $components define the color space (1 - gray, 3 - RGB, 4 - CMYK). The color values must be between 0 and 1.
It is also possible to pass a hexadecimal string of an RGB value. The string need to be prefixed by a sharp (#).

Exceptions

Throws InvalidArgumentException

hexToRgb()

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

Converts a hex encoded string into a component array of red, green and blue values.

Parameters
$hex : string
 

writePdfString()

static public void SetaPDF_Core_DataStructure_Color_Cmyk::writePdfString ( SetaPDF_Core_WriteInterface $writer, array|float $componentsOrC [, boolean|float $strokingOrM = 0.0 [, float $y = 0.0 [, float $k = 0.0 [, boolean $stroking = true ]]]] )

Writes a color definition directly to a writer.

Parameters
$writer : SetaPDF_Core_WriteInterface
 
$componentsOrC : array|float

An array of 4 components or the value for the cyan component

$strokingOrM : boolean|float

Stroking flag or the value for the magenta component

$y : float

The value for the yellow component

$k : float

The value for the black component

$stroking : boolean

Stroking flag

Exceptions

Throws InvalidArgumentException

writePdfStringByComponents()

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

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_Cmyk::__construct ( SetaPDF_Core_Type_Array|array|float $componentsOrC [, float $m = 0.0 [, float $y = 0.0 [, float $k = 0.0 ]]] )

The constructor.

Parameters
$componentsOrC : SetaPDF_Core_Type_Array|array|float
 
$m : float
 
$y : float
 
$k : float
 
Exceptions

Throws InvalidArgumentException

__clone()

Implementation of __clone().

adjustAllComponents()

Adjust all color components by a specific value.

Parameters
$by : int|float
 

draw()

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

Draw the color on a writer.

Parameters
$writer : SetaPDF_Core_WriteInterface
 
$stroking : boolean
 
See

getValue()

Get the components of the color.

toPhp()

Get the data as a PHP value.