Hex
in package
implements
ArrayAccess, ColorInterface
Pop CSS Hex color class
Tags
Interfaces, Classes, Traits and Enums
- ArrayAccess
- ColorInterface
- Pop CSS color interface
Table of Contents
- $b : string
- B value
- $g : string
- G value
- $hex : string
- Hex value
- $r : string
- R value
- __construct() : mixed
- Constructor
- __get() : mixed
- Magic method to return the color value
- __isset() : bool
- Magic method to return whether the color value exists
- __set() : void
- Magic method to set the color value
- __toString() : string
- Return CSS-formatted string
- __unset() : void
- Magic method to unset color value
- getB() : string
- Get B value
- getG() : string
- Get G value
- getHex() : string
- Get hex value
- getR() : string
- Get R value
- isValid() : bool
- Method to determine if the hex value is valid
- offsetExists() : bool
- ArrayAccess offsetExists
- offsetGet() : mixed
- ArrayAccess offsetGet
- offsetSet() : void
- ArrayAccess offsetSet
- offsetUnset() : void
- ArrayAccess offsetUnset
- render() : string
- Convert to CSS-formatted string
- setB() : self
- Set B value
- setG() : self
- Set G value
- setHex() : self
- Set hex value
- setR() : self
- Set R value
- toArray() : array<string|int, mixed>
- Convert to array
- toHsl() : Hsl
- Convert to HSL
- toRgb() : Rgb
- Convert to RGB
Properties
$b
B value
protected
string
$b
= null
$g
G value
protected
string
$g
= null
$hex
Hex value
protected
string
$hex
= null
$r
R value
protected
string
$r
= null
Methods
__construct()
Constructor
public
__construct(string $hex) : mixed
Instantiate the CSS hex color object
Parameters
- $hex : string
Return values
mixed —__get()
Magic method to return the color value
public
__get(string $name) : mixed
Parameters
- $name : string
Return values
mixed —__isset()
Magic method to return whether the color value exists
public
__isset(string $name) : bool
Parameters
- $name : string
Return values
bool —__set()
Magic method to set the color value
public
__set(string $name, mixed $value) : void
Parameters
- $name : string
- $value : mixed
Return values
void —__toString()
Return CSS-formatted string
public
__toString() : string
Return values
string —__unset()
Magic method to unset color value
public
__unset(string $name) : void
Parameters
- $name : string
Tags
Return values
void —getB()
Get B value
public
getB() : string
Return values
string —getG()
Get G value
public
getG() : string
Return values
string —getHex()
Get hex value
public
getHex() : string
Return values
string —getR()
Get R value
public
getR() : string
Return values
string —isValid()
Method to determine if the hex value is valid
public
isValid(string $hex) : bool
Parameters
- $hex : string
Return values
bool —offsetExists()
ArrayAccess offsetExists
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
bool —offsetGet()
ArrayAccess offsetGet
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
Tags
Return values
mixed —offsetSet()
ArrayAccess offsetSet
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
Tags
Return values
void —offsetUnset()
ArrayAccess offsetUnset
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
Tags
Return values
void —render()
Convert to CSS-formatted string
public
render() : string
Return values
string —setB()
Set B value
public
setB(string $b) : self
Parameters
- $b : string
Tags
Return values
self —setG()
Set G value
public
setG(string $g) : self
Parameters
- $g : string
Tags
Return values
self —setHex()
Set hex value
public
setHex(string $hex) : self
Parameters
- $hex : string
Tags
Return values
self —setR()
Set R value
public
setR(string $r) : self
Parameters
- $r : string
Tags
Return values
self —toArray()
Convert to array
public
toArray([bool $assoc = true ]) : array<string|int, mixed>
Parameters
- $assoc : bool = true
Return values
array<string|int, mixed> —toHsl()
Convert to HSL
public
toHsl() : Hsl
Return values
Hsl —toRgb()
Convert to RGB
public
toRgb() : Rgb