Table of contents
Namespace: Com\Tecnick\Color\Model
interface Template
Source: src/Model/Template.php:34
Color Model Interface
Methods
getArray()
Get an array with all color components.
public getArray(): array<string,float>
Returns: array<string,float>
Source: src/Model/Template.php:41
getComponentsString()
Get a space separated string with color component values.
public getComponentsString(): string
Returns: string
Source: src/Model/Template.php:85
getCssColor()
Get the CSS representation of the color
public getCssColor(): string
Returns: string
Source: src/Model/Template.php:74
getJsPdfColor()
Get the color format used in Acrobat JavaScript.
NOTE: the alpha channel is omitted from this representation unless it is 0 = transparent
public getJsPdfColor(): string
Returns: string
Source: src/Model/Template.php:80
getNormalizedArray()
Get an array with color components values normalized between 0 and $max.
NOTE: the alpha and other fraction component values are kept in the [0..1] range.
$max applies to the components that have no range of their own (GRAY, RGB and CMYK) and is ignored by HSL and LAB, whose components are returned in degrees and in the CIE Lab ranges.
public getNormalizedArray(int $max): array<string,float>
Parameters:
$max(int): Maximum value to return (reference value)
Returns: array<string,float>
Source: src/Model/Template.php:69
getPDFacArray()
Get an array with all color components for the PDF appearance characteristics dictionary.
The values are in the range 0.0 to 1.0 and the number of array elements determines the color space: 1 = DeviceGray 3 = DeviceRGB 4 = DeviceCMYK
public getPDFacArray(): float[]
Returns: float[]
Source: src/Model/Template.php:55
getPdfColor()
Get the color components format used in PDF documents (RGB).
NOTE: the alpha channel is omitted.
public getPdfColor(bool $stroke = false): string
Parameters:
$stroke(bool): True for stroking (lines, drawing) and false for non-stroking (text and area filling).
Returns: string
Source: src/Model/Template.php:93
invertColor()
Invert the color in place and return $this.
Use withInvertedColor() to leave the receiver untouched.
public invertColor(): static
Returns: static
Source: src/Model/Template.php:135
toCmykArray()
Get an array with CMYK color components.
public toCmykArray(): array<string,float>
Returns: array<string,float>: with keys (‘cyan’, ‘magenta’, ‘yellow’, ‘key’, ‘alpha’).
Source: src/Model/Template.php:121
toGrayArray()
Get an array with Gray color components.
public toGrayArray(): array<string,float>
Returns: array<string,float>: with keys (‘gray’, ‘alpha’).
Source: src/Model/Template.php:100
toHslArray()
Get an array with HSL color components.
public toHslArray(): array<string,float>
Returns: array<string,float>: with keys (‘hue’, ‘saturation’, ’lightness’, ‘alpha’).
Source: src/Model/Template.php:114
toLabArray()
Get an array with Lab color components.
public toLabArray(): array<string,float>
Returns: array<string,float>: with keys (’lstar’, ‘astar’, ‘bstar’, ‘alpha’).
Source: src/Model/Template.php:128
toRgbArray()
Get an array with RGB color components.
public toRgbArray(): array<string,float>
Returns: array<string,float>: with keys (‘red’, ‘green’, ‘blue’, ‘alpha’).
Source: src/Model/Template.php:107
withInvertedColor()
Get a copy of the color, inverted.
public withInvertedColor(): static
Returns: static
Source: src/Model/Template.php:140