Model
in package
AbstractYes
Com\Tecnick\Color\Model
Color Model class
Tags
Table of Contents
Interfaces
- Template
- Com\Tecnick\Color\Model\Template
Methods
- __construct() : mixed
- Initialize a new color object.
- getHexValue() : string
- Get the normalized hexadecimal value of the specified float fraction
- getNormalizedValue() : float
- Get the normalized integer value of the specified float fraction
- getRgbaHexColor() : string
- Get the Hexadecimal representation of the color with alpha channel: #RRGGBBAA
- getRgbHexColor() : string
- Get the Hexadecimal representation of the color: #RRGGBB
- getType() : string
- Get the color model type (GRAY, RGB, HSL, CMYK)
Methods
__construct()
Initialize a new color object.
public __construct(array<string,
int|float|string> $components)
: mixed
Parameters
- $components : array<string, int|float|string>
-
color components.
getHexValue()
Get the normalized hexadecimal value of the specified float fraction
public getHexValue(float $value,
int $max)
: string
Parameters
- $value : float
-
Fraction value to convert [0..1]
- $max : int
-
Maximum value to return (reference value)
Return values
stringgetNormalizedValue()
Get the normalized integer value of the specified float fraction
public getNormalizedValue(float $value,
int $max)
: float
Parameters
- $value : float
-
Fraction value to convert [0..1]
- $max : int
-
Maximum value to return (reference value)
Return values
float —value [0..$max]
getRgbaHexColor()
Get the Hexadecimal representation of the color with alpha channel: #RRGGBBAA
public getRgbaHexColor()
: string
Return values
stringgetRgbHexColor()
Get the Hexadecimal representation of the color: #RRGGBB
public getRgbHexColor()
: string
Return values
stringgetType()
Get the color model type (GRAY, RGB, HSL, CMYK)
public getType()
: string