\GrafikaColor

Holds the color information.

Summary

Methods
Properties
Constants
__construct()
getRgb()
getRgba()
hexToRgb()
getHexString()
setHexString()
getAlpha()
setAlpha()
No public properties found
No constants found
No protected methods found
$hexString
$alpha
N/A
No private methods found
No private properties found
N/A

Properties

$hexString

$hexString : string

Type

string — Hex string: #FFFFFF

$alpha

$alpha : float

Type

float — Transparency value 0-1

Methods

__construct()

__construct(string  $hexString = '', float  $alpha = 1.0) 

Color constructor.

Parameters

string $hexString

Hex string

float $alpha

Transparency value 0-1

getRgb()

getRgb() : array

Get RGB array

Returns

array —

Contains array($r, $g, $b)

getRgba()

getRgba() : array

Get RGBA array

Returns

array —

Contains array($r, $g, $b, $a)

hexToRgb()

hexToRgb(string  $hex) : array

Convert hex string to RGB

Parameters

string $hex

Hex string. Possible values: #ffffff, #fff, fff

Returns

array —

Contains (RGB) values red, green and blue

getHexString()

getHexString() : string

Get hex string.

Returns

string

setHexString()

setHexString(string  $hexString) 

Set hex string.

Parameters

string $hexString

getAlpha()

getAlpha() : float

Alpha value.

Returns

float

setAlpha()

setAlpha(float  $alpha) 

Parameters

float $alpha