Table of contents
Namespace: Com\Tecnick\Color\Model
File: Template.php line 34
Color Model Interface
Tags
- since: 2015-02-21
- category: Library
- author: Nicola Asuni info@tecnick.com
- copyright: 2015-2026 Nicola Asuni - Tecnick.com LTD
- license: https://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE)
- link: https://github.com/tecnickcom/tc-lib-color
Methods
getArray()
File: Template.php line 41
public getArray() : array<string, float>
Return values
array<string, float>
getComponentsString()
File: Template.php line 85
public getComponentsString() : string
Return values
string
getCssColor()
File: Template.php line 74
public getCssColor() : string
Return values
string
getJsPdfColor()
File: Template.php line 80
public getJsPdfColor() : string
NOTE: the alpha channel is omitted from this representation unless it is 0 = transparent
Return values
string
getNormalizedArray()
File: Template.php line 69
public getNormalizedArray(int $max) : array<string, float>
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.
Parameters
- $max : int: Maximum value to return (reference value)
Return values
array<string, float>
getPDFacArray()
File: Template.php line 55
public getPDFacArray() : array<string|int, float>
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
Return values
array<string|int, float>
getPdfColor()
File: Template.php line 93
public getPdfColor([bool $stroke = false ]) : string
NOTE: the alpha channel is omitted.
Parameters
- $stroke : bool = false: True for stroking (lines, drawing) and false for non-stroking (text and area filling).
Return values
string
invertColor()
File: Template.php line 135
public invertColor() : static
Use withInvertedColor() to leave the receiver untouched.
Return values
static
toCmykArray()
File: Template.php line 121
public toCmykArray() : array<string, float>
Return values
array<string, float> —
with keys (‘cyan’, ‘magenta’, ‘yellow’, ‘key’, ‘alpha’).
toGrayArray()
File: Template.php line 100
public toGrayArray() : array<string, float>
Return values
array<string, float> —
with keys (‘gray’, ‘alpha’).
toHslArray()
File: Template.php line 114
public toHslArray() : array<string, float>
Return values
array<string, float> —
with keys (‘hue’, ‘saturation’, ’lightness’, ‘alpha’).
toLabArray()
File: Template.php line 128
public toLabArray() : array<string, float>
Return values
array<string, float> —
with keys (’lstar’, ‘astar’, ‘bstar’, ‘alpha’).
toRgbArray()
File: Template.php line 107
public toRgbArray() : array<string, float>
Return values
array<string, float> —
with keys (‘red’, ‘green’, ‘blue’, ‘alpha’).
withInvertedColor()
File: Template.php line 140
public withInvertedColor() : static
Return values
static