Rgb
extends AbstractColor
in package
implements
ArrayAccess
Pop Color RGB color class
Tags
Table of Contents
Interfaces
- ArrayAccess
Constants
Properties
Methods
- __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
- getA() : float|null
- Get A value
- getB() : int
- Get B value
- getG() : int
- Get G value
- getR() : int
- Get R value
- hasA() : bool
- Determine if the color object has an alpha value
- hasAlpha() : bool
- Determine if the color object has an alpha value (alias)
- offsetExists() : bool
- ArrayAccess offsetExists
- offsetGet() : mixed
- ArrayAccess offsetGet
- offsetSet() : void
- ArrayAccess offsetSet
- offsetUnset() : void
- ArrayAccess offsetUnset
- render() : string
- Convert to readable string
- setA() : self
- Set A value
- setB() : self
- Set B value
- setG() : self
- Set G value
- setR() : self
- Set R value
- toArray() : array<string|int, mixed>
- Convert to array
- toCmyk() : Cmyk
- Convert to CMYK
- toGray() : Grayscale
- Convert to Gray
- toHex() : Hex
- Convert to hex
- toHsl() : Hsl
- Convert to HSL
Constants
COMMA
String formats
public
mixed
COMMA
= 'COMMA'
CSS
public
mixed
CSS
= 'CSS'
PERCENT
public
mixed
PERCENT
= 'PERCENT'
Properties
$a
Alpha value
protected
float|null
$a
= null
$b
B value
protected
int
$b
= 0
$g
G value
protected
int
$g
= 0
$r
R value
protected
int
$r
= 0
Methods
__construct()
Constructor
public
__construct(int|string $r, int|string $g, int|string $b[, float|string|null $a = null ]) : mixed
Instantiate the CSS RGB color object
Parameters
- $r : int|string
- $g : int|string
- $b : int|string
- $a : float|string|null = null
__get()
Magic method to return the color value
public
__get(string $name) : mixed
Parameters
- $name : string
Tags
__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
Tags
__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
getA()
Get A value
public
getA() : float|null
Return values
float|nullgetB()
Get B value
public
getB() : int
Return values
intgetG()
Get G value
public
getG() : int
Return values
intgetR()
Get R value
public
getR() : int
Return values
inthasA()
Determine if the color object has an alpha value
public
hasA() : bool
Return values
boolhasAlpha()
Determine if the color object has an alpha value (alias)
public
hasAlpha() : bool
Return values
booloffsetExists()
ArrayAccess offsetExists
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
booloffsetGet()
ArrayAccess offsetGet
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
Tags
offsetSet()
ArrayAccess offsetSet
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
Tags
offsetUnset()
ArrayAccess offsetUnset
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
Tags
render()
Convert to readable string
public
render([string|null $format = null ]) : string
Parameters
- $format : string|null = null
Return values
stringsetA()
Set A value
public
setA(float|string $a) : self
Parameters
- $a : float|string
Tags
Return values
selfsetB()
Set B value
public
setB(int|string $b) : self
Parameters
- $b : int|string
Tags
Return values
selfsetG()
Set G value
public
setG(int|string $g) : self
Parameters
- $g : int|string
Tags
Return values
selfsetR()
Set R value
public
setR(int|string $r) : self
Parameters
- $r : int|string
Tags
Return values
selftoArray()
Convert to array
public
toArray([bool $assoc = true ]) : array<string|int, mixed>
Parameters
- $assoc : bool = true
Return values
array<string|int, mixed>toCmyk()
Convert to CMYK
public
toCmyk() : Cmyk
Return values
CmyktoGray()
Convert to Gray
public
toGray() : Grayscale
Return values
GrayscaletoHex()
Convert to hex
public
toHex() : Hex
Return values
HextoHsl()
Convert to HSL
public
toHsl() : Hsl