Color
in package
Table of Contents
- $blue : int
- RGB Blue value of current color instance.
- $green : int
- RGB Green value of current color instance.
- $red : int
- RGB Red value of current color instance.
- __construct() : mixed
- Creates new instance.
- __toString() : string
- Get color as string.
- format() : string|int|array<string|int, mixed>|self
- Formats current color instance into given format.
- getArray() : array<string|int, mixed>
- Calculates RGB in array format of current color instance.
- getBlue() : int
- Get blue value.
- getGreen() : int
- Get green value.
- getHex() : string
- Calculates hexadecimal value of current color instance.
- getInt() : int
- Calculates integer value of current color instance.
- getRed() : int
- Get red value.
- getRgb() : string
- Calculates RGB in string format of current color instance.
Properties
$blue
RGB Blue value of current color instance.
private
int
$blue
$green
RGB Green value of current color instance.
private
int
$green
$red
RGB Red value of current color instance.
private
int
$red
Methods
__construct()
Creates new instance.
public
__construct(int $red, int $green, int $blue) : mixed
Parameters
- $red : int
- $green : int
- $blue : int
Return values
mixed —__toString()
Get color as string.
public
__toString() : string
Return values
string —format()
Formats current color instance into given format.
public
format(string $type) : string|int|array<string|int, mixed>|self
Parameters
- $type : string
Tags
Return values
string|int|array<string|int, mixed>|self —getArray()
Calculates RGB in array format of current color instance.
public
getArray() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getBlue()
Get blue value.
public
getBlue() : int
Return values
int —getGreen()
Get green value.
public
getGreen() : int
Return values
int —getHex()
Calculates hexadecimal value of current color instance.
public
getHex([string $prefix = '' ]) : string
Parameters
- $prefix : string = ''
Return values
string —getInt()
Calculates integer value of current color instance.
public
getInt() : int
Return values
int —getRed()
Get red value.
public
getRed() : int
Return values
int —getRgb()
Calculates RGB in string format of current color instance.
public
getRgb() : string