Properties

$r

$r : int

RGB Red value of current color instance

Type

int

$g

$g : int

RGB Green value of current color instance

Type

int

$b

$b : int

RGB Blue value of current color instance

Type

int

$a

$a : float

RGB Alpha value of current color instance

Type

float

Methods

initFromInteger()

initFromInteger(int  $value) : \Intervention\Image\AbstractColor

Initiates color object from integer

Parameters

int $value

Returns

\Intervention\Image\AbstractColor —

initFromArray()

initFromArray(mixed  $array) : \Intervention\Image\AbstractColor

Initiates color object from given array

Parameters

mixed $array

Returns

\Intervention\Image\AbstractColor —

initFromString()

initFromString(string  $value) : \Intervention\Image\AbstractColor

Initiates color object from given string

Parameters

string $value

Returns

\Intervention\Image\AbstractColor —

initFromObject()

initFromObject(\Intervention\Image\Gd\ImagickPixel  $value) : \Intervention\Image\AbstractColor

Initiates color object from given ImagickPixel object

Parameters

\Intervention\Image\Gd\ImagickPixel $value

Returns

\Intervention\Image\AbstractColor —

initFromRgb()

initFromRgb(int  $r, int  $g, int  $b) : \Intervention\Image\AbstractColor

Initiates color object from given R, G and B values

Parameters

int $r
int $g
int $b

Returns

\Intervention\Image\AbstractColor —

initFromRgba()

initFromRgba(int  $r, int  $g, int  $b, float  $a = 1) : \Intervention\Image\AbstractColor

Initiates color object from given R, G, B and A values

Parameters

int $r
int $g
int $b
float $a

Returns

\Intervention\Image\AbstractColor —

getInt()

getInt() : int

Calculates integer value of current color instance

Returns

int —

getHex()

getHex(string  $prefix = '') : string

Calculates hexadecimal value of current color instance

Parameters

string $prefix

Returns

string —

getArray()

getArray() : array

Calculates RGB(A) in array format of current color instance

Returns

array —

getRgba()

getRgba() : string

Calculates RGBA in string format of current color instance

Returns

string —

differs()

differs(\Intervention\Image\AbstractColor  $color, int  $tolerance) : bool

Determines if current color is different from given color

Parameters

\Intervention\Image\AbstractColor $color
int $tolerance

Returns

bool —

__construct()

__construct(mixed  $value = null) : mixed

Creates new instance

Parameters

mixed $value

Returns

mixed —

parse()

parse(mixed  $value) : \Intervention\Image\AbstractColor

Parses given value as color

Parameters

mixed $value

Returns

\Intervention\Image\AbstractColor —

format()

format(string  $type) : mixed

Formats current color instance into given format

Parameters

string $type

Returns

mixed —

rgbaFromString()

rgbaFromString(string  $value) : array

Reads RGBA values from string into array

Parameters

string $value

Returns

array —

alpha2gd()

alpha2gd(float  $input) : int

Convert rgba alpha (0-1) value to gd value (0-127)

Parameters

float $input

Returns

int —