Color
extends AbstractColor
in package
Table of Contents
Properties
- $pixel : ImagickPixel
- ImagickPixel containing current color information
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
- getAlphaValue() : float
- Returns RGB alpha value of current color
- getArray() : array<string|int, mixed>
- Calculates RGB(A) in array format of current color instance
- getBlueValue() : int
- Returns RGB blue value of current color
- getGreenValue() : int
- Returns RGB green value of current color
- getHex() : string
- Calculates hexadecimal value of current color instance
- getInt() : int
- Calculates integer value of current color instance
- getPixel() : ImagickPixel
- Returns current color as ImagickPixel
- getRedValue() : int
- Returns RGB red value of current color
- 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
- rgb2alpha() : float
- Calculates RGA integer alpha value into float value
- setPixel() : ImagickPixel
- Initiates ImagickPixel from given RGBA values
Properties
$pixel
ImagickPixel containing current color information
public
ImagickPixel
$pixel
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
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
getAlphaValue()
Returns RGB alpha value of current color
public
getAlphaValue() : float
Return values
floatgetArray()
Calculates RGB(A) in array format of current color instance
public
getArray() : array<string|int, mixed>
Return values
array<string|int, mixed>getBlueValue()
Returns RGB blue value of current color
public
getBlueValue() : int
Return values
intgetGreenValue()
Returns RGB green value of current color
public
getGreenValue() : int
Return values
intgetHex()
Calculates hexadecimal value of current color instance
public
getHex([string $prefix = '' ]) : string
Parameters
- $prefix : string = ''
Return values
stringgetInt()
Calculates integer value of current color instance
public
getInt() : int
Return values
intgetPixel()
Returns current color as ImagickPixel
public
getPixel() : ImagickPixel
Return values
ImagickPixelgetRedValue()
Returns RGB red value of current color
public
getRedValue() : int
Return values
intgetRgba()
Calculates RGBA in string format of current color instance
public
getRgba() : string
Return values
stringinitFromArray()
Initiates color object from given array
public
initFromArray(mixed $array) : AbstractColor
Parameters
- $array : mixed
Return values
AbstractColorinitFromInteger()
Initiates color object from integer
public
initFromInteger(int $value) : AbstractColor
Parameters
- $value : int
Return values
AbstractColorinitFromObject()
Initiates color object from given ImagickPixel object
public
initFromObject(ImagickPixel $value) : AbstractColor
Parameters
- $value : ImagickPixel
Return values
AbstractColorinitFromRgb()
Initiates color object from given R, G and B values
public
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
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
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
Return values
array<string|int, mixed>rgb2alpha()
Calculates RGA integer alpha value into float value
private
rgb2alpha(int $value) : float
Parameters
- $value : int
Return values
floatsetPixel()
Initiates ImagickPixel from given RGBA values
private
setPixel(mixed $r, mixed $g, mixed $b[, mixed $a = null ]) : ImagickPixel
Parameters
- $r : mixed
- $g : mixed
- $b : mixed
- $a : mixed = null