AbstractColor
in package
AbstractYes
Table of Contents
Methods
- __construct() : mixed
- Creates new instance
- differs() : bool
- Determines if current color is different from given color
- format() : mixed
- Formats current color instance into given format
- getArray() : array<string|int, mixed>
- Calculates RGB(A) in array format of current color instance
- getHex() : string
- Calculates hexadecimal value of current color instance
- getInt() : int
- Calculates integer value of current color instance
- getRgba() : string
- Calculates RGBA in string format of current color instance
- initFromArray() : AbstractColor
- Initiates color object from given array
- initFromInteger() : AbstractColor
- Initiates color object from integer
- initFromObject() : AbstractColor
- Initiates color object from given ImagickPixel object
- initFromRgb() : AbstractColor
- Initiates color object from given R, G and B values
- initFromRgba() : AbstractColor
- Initiates color object from given R, G, B and A values
- initFromString() : AbstractColor
- Initiates color object from given string
- parse() : AbstractColor
- Parses given value as color
- rgbaFromString() : array<string|int, mixed>
- Reads RGBA values from string into array
Methods
__construct()
Creates new instance
public
__construct([mixed $value = null ]) : mixed
Parameters
- $value : mixed = null
differs()
Determines if current color is different from given color
public
abstract differs(AbstractColor $color[, int $tolerance = 0 ]) : bool
Parameters
- $color : AbstractColor
- $tolerance : int = 0
Return values
boolformat()
Formats current color instance into given format
public
format(string $type) : mixed
Parameters
- $type : string
getArray()
Calculates RGB(A) in array format of current color instance
public
abstract getArray() : array<string|int, mixed>
Return values
array<string|int, mixed>getHex()
Calculates hexadecimal value of current color instance
public
abstract getHex(string $prefix) : string
Parameters
- $prefix : string
Return values
stringgetInt()
Calculates integer value of current color instance
public
abstract getInt() : int
Return values
intgetRgba()
Calculates RGBA in string format of current color instance
public
abstract getRgba() : string
Return values
stringinitFromArray()
Initiates color object from given array
public
abstract initFromArray(array<string|int, mixed> $value) : AbstractColor
Parameters
- $value : array<string|int, mixed>
Return values
AbstractColorinitFromInteger()
Initiates color object from integer
public
abstract initFromInteger(int $value) : AbstractColor
Parameters
- $value : int
Return values
AbstractColorinitFromObject()
Initiates color object from given ImagickPixel object
public
abstract initFromObject(ImagickPixel $value) : AbstractColor
Parameters
- $value : ImagickPixel
Return values
AbstractColorinitFromRgb()
Initiates color object from given R, G and B values
public
abstract initFromRgb(int $r, int $g, int $b) : AbstractColor
Parameters
- $r : int
- $g : int
- $b : int
Return values
AbstractColorinitFromRgba()
Initiates color object from given R, G, B and A values
public
abstract initFromRgba(int $r, int $g, int $b, float $a) : AbstractColor
Parameters
- $r : int
- $g : int
- $b : int
- $a : float
Return values
AbstractColorinitFromString()
Initiates color object from given string
public
abstract initFromString(string $value) : AbstractColor
Parameters
- $value : string
Return values
AbstractColorparse()
Parses given value as color
public
parse(mixed $value) : AbstractColor
Parameters
- $value : mixed
Return values
AbstractColorrgbaFromString()
Reads RGBA values from string into array
protected
rgbaFromString(string $value) : array<string|int, mixed>
Parameters
- $value : string