class ColorValue extends Value (View source)

Properties

protected string $variable

The name of the LESS variable.

from  Value
protected mixed $r

The value of the red channel.

protected mixed $g

The value of the green channel.

protected mixed $b

The value of the blue channel.

protected mixed $a

The value of the alpha channel.

Methods

__construct(string $variable = '')

Initialize the instance.

from  Value
string
getVariable()

Get the name of the LESS variable.

from  Value
string
toStyleString()

Get the CSS representation of this value.

array
toLessVariablesArray()

Get the LESS representation of this variable and associated values.

$this
setRed(mixed $r)

Set the value of the red channel.

$this
setGreen(mixed $g)

Set the value of the green channel.

$this
setBlue(mixed $b)

Set the value of the blue channel.

$this
setAlpha(mixed $a)

Set the value of the alpha channel.

mixed
getRed()

Get the value of the red channel.

mixed
getGreen()

Get the value of the green channel.

mixed
getBlue()

Get the value of the blue channel.

mixed
getAlpha()

Get the value of the alpha channel.

bool
hasAlpha()

Is the alpha channel set?

Details

__construct(string $variable = '')

Initialize the instance.

Parameters

string $variable

the name of the LESS variable

string getVariable()

Get the name of the LESS variable.

Return Value

string

string toStyleString()

Get the CSS representation of this value.

Return Value

string

See also

Value::toStyleString

array toLessVariablesArray()

Get the LESS representation of this variable and associated values.

Return Value

array

See also

Value::toLessVariablesArray

$this setRed(mixed $r)

Set the value of the red channel.

Parameters

mixed $r

Return Value

$this

$this setGreen(mixed $g)

Set the value of the green channel.

Parameters

mixed $g

Return Value

$this

$this setBlue(mixed $b)

Set the value of the blue channel.

Parameters

mixed $b

Return Value

$this

$this setAlpha(mixed $a)

Set the value of the alpha channel.

Parameters

mixed $a

Return Value

$this

mixed getRed()

Get the value of the red channel.

Return Value

mixed

mixed getGreen()

Get the value of the green channel.

Return Value

mixed

mixed getBlue()

Get the value of the blue channel.

Return Value

mixed

mixed getAlpha()

Get the value of the alpha channel.

Return Value

mixed

bool hasAlpha()

Is the alpha channel set?

Return Value

bool