Documentation

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
bool

format()

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
float

getArray()

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
int

getGreenValue()

Returns RGB green value of current color

public getGreenValue() : 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

getPixel()

Returns current color as ImagickPixel

public getPixel() : ImagickPixel
Return values
ImagickPixel

getRedValue()

Returns RGB red value of current color

public getRedValue() : int
Return values
int

getRgba()

Calculates RGBA in string format of current color instance

public getRgba() : string
Return values
string

initFromArray()

Initiates color object from given array

public initFromArray(mixed $array) : AbstractColor
Parameters
$array : mixed
Return values
AbstractColor

initFromObject()

Initiates color object from given ImagickPixel object

public initFromObject(ImagickPixel $value) : AbstractColor
Parameters
$value : ImagickPixel
Return values
AbstractColor

initFromRgb()

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
AbstractColor

initFromRgba()

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
AbstractColor

initFromString()

Initiates color object from given string

public initFromString(string $value) : AbstractColor
Parameters
$value : string
Return values
AbstractColor

rgbaFromString()

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
float

setPixel()

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
Return values
ImagickPixel

        
On this page

Search results