\Pop\Css\ColorHsl

Pop CSS HSL color class

Summary

Methods
Properties
Constants
__construct()
setH()
setS()
setL()
setA()
getH()
getS()
getL()
getA()
hasA()
hasAlpha()
toRgb()
toHex()
toArray()
render()
__toString()
__set()
__get()
__isset()
__unset()
offsetExists()
offsetGet()
offsetSet()
offsetUnset()
No public properties found
No constants found
No protected methods found
$h
$s
$l
$a
N/A
No private methods found
No private properties found
N/A

Properties

$h

$h : integer

H value

Type

integer

$s

$s : integer

S value

Type

integer

$l

$l : integer

L value

Type

integer

$a

$a : integer

Alpha value

Type

integer

Methods

__construct()

__construct(integer  $h, integer  $s, integer  $l, float  $a = null) 

Constructor

Instantiate the CSS HSL color object

Parameters

integer $h
integer $s
integer $l
float $a

setH()

setH(integer  $h) : self

Set H value

Parameters

integer $h

Throws

\OutOfRangeException

Returns

self

setS()

setS(integer  $s) : self

Set S value

Parameters

integer $s

Throws

\OutOfRangeException

Returns

self

setL()

setL(integer  $l) : self

Set L value

Parameters

integer $l

Throws

\OutOfRangeException

Returns

self

setA()

setA(float  $a) : self

Set A value

Parameters

float $a

Throws

\OutOfRangeException

Returns

self

getH()

getH() : integer

Get H value

Returns

integer

getS()

getS() : integer

Get S value

Returns

integer

getL()

getL() : integer

Get L value

Returns

integer

getA()

getA() : float

Get A value

Returns

float

hasA()

hasA() : boolean

Determine if the color object has an alpha value

Returns

boolean

hasAlpha()

hasAlpha() : boolean

Determine if the color object has an alpha value (alias)

Returns

boolean

toArray()

toArray(boolean  $assoc = true) : array

Convert to array

Parameters

boolean $assoc

Returns

array

render()

render() : string

Convert to CSS-formatted string

Returns

string

__toString()

__toString() : string

Return CSS-formatted string

Returns

string

__set()

__set(string  $name, mixed  $value) : void

Magic method to set the color value

Parameters

string $name
mixed $value

__get()

__get(string  $name) : mixed

Magic method to return the color value

Parameters

string $name

Returns

mixed

__isset()

__isset(string  $name) : boolean

Magic method to return whether the color value exists

Parameters

string $name

Returns

boolean

__unset()

__unset(string  $name) : void

Magic method to unset color value

Parameters

string $name

Throws

\Pop\Css\Color\Exception

offsetExists()

offsetExists(mixed  $offset) : boolean

ArrayAccess offsetExists

Parameters

mixed $offset

Returns

boolean

offsetGet()

offsetGet(mixed  $offset) : mixed

ArrayAccess offsetGet

Parameters

mixed $offset

Throws

\Pop\Css\Color\Exception

Returns

mixed

offsetSet()

offsetSet(mixed  $offset, mixed  $value) : void

ArrayAccess offsetSet

Parameters

mixed $offset
mixed $value

Throws

\Pop\Css\Color\Exception

offsetUnset()

offsetUnset(mixed  $offset) : void

ArrayAccess offsetUnset

Parameters

mixed $offset

Throws

\Pop\Css\Color\Exception