AbstractColor
in package
implements
ColorInterface, ArrayAccess
Abstract image color class
Tags
Table of Contents
Interfaces
- ColorInterface
- Image color interface
- ArrayAccess
Constants
Methods
- __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
- Method to print the color object
- __unset() : void
- Magic method to unset color value
- offsetExists() : bool
- ArrayAccess offsetExists
- offsetGet() : mixed
- ArrayAccess offsetGet
- offsetSet() : void
- ArrayAccess offsetSet
- offsetUnset() : void
- ArrayAccess offsetUnset
- render() : string
- Convert to readable string
- toCss() : string
- Convert to a CSS-formatted string, regardless of the class's default __toString() format
- channels() : array<string|int, mixed>
- Get the valid channel names for this color type, e.g. ['r', 'g', 'b', 'a']
- channelsForError() : string
- Format the valid channel names for an exception message, e.g. "'r', 'g', 'b' or 'a'"
Constants
COMMA
String formats
public
mixed
COMMA
= 'COMMA'
CSS
public
mixed
CSS
= 'CSS'
PERCENT
public
mixed
PERCENT
= 'PERCENT'
Methods
__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()
Method to print the color object
public
abstract __toString() : string
Return values
string__unset()
Magic method to unset color value
public
__unset(string $name) : void
Parameters
- $name : string
Tags
offsetExists()
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
abstract render([string|null $format = null ]) : string
Parameters
- $format : string|null = null
Return values
stringtoCss()
Convert to a CSS-formatted string, regardless of the class's default __toString() format
public
toCss() : string
Return values
stringchannels()
Get the valid channel names for this color type, e.g. ['r', 'g', 'b', 'a']
protected
abstract channels() : array<string|int, mixed>
Every channel name here must have matching get{Name}()/set{Name}() methods (e.g. 'gray' => getGray()/setGray()) - that convention is what offsetGet()/offsetSet() dispatch on.
Return values
array<string|int, mixed>channelsForError()
Format the valid channel names for an exception message, e.g. "'r', 'g', 'b' or 'a'"
protected
channelsForError() : string