Colorist
class Colorist
Main class for manipulation with color models
Properties
| protected array | $classes | List of model classes | |
| protected array | $models | Loaded models | |
| protected array | $channels | List supported channels. Automatically generated list | |
| protected array | $types | List supported types. Automatically generated list |
Methods
Colorist constructor.
No description
No description
Set one channel
Get value of one channel
Set model
Loading models
Loading channels
Loading types
Detecting the parser from the set value
Getting the model and values from other. Format: rgb(0,0,0); hsv(15,10,3)
Getting the model and values from hex. Format: #000; #112233
Getting the model and values from name. Format: orange; red
Getting a model by type
Details
at line 59
__construct(string $value = NULL)
Colorist constructor.
at line 93
static Colorist
create(string $value)
Static method for create and set
at line 101
array
getChannelsList()
at line 109
array
getTypesList()
at line 122
setChannel(string $channel, string|integer|float $value)
Set one channel
at line 146
float|int|string
getChannel(string $channel)
Get value of one channel
at line 172
void
set(string $model, string $value)
Set model
at line 188
stdClass|string
get(string $model, bool $withAlpha = false, bool $toString = false)
Get model
at line 198
protected
loadModels()
Loading models
at line 215
protected
loadChannels(array $channels)
Loading channels
at line 225
protected
loadTypes(array $types)
Loading types
at line 238
protected string
detectParser(string $value)
Detecting the parser from the set value
at line 256
protected array
otherParser(string $value)
Getting the model and values from other. Format: rgb(0,0,0); hsv(15,10,3)
at line 271
protected array
hexParser(string $value)
Getting the model and values from hex. Format: #000; #112233
at line 288
protected array
nameParser(string $value)
Getting the model and values from name. Format: orange; red
at line 301
protected ModelInterface|null
getModel(string $type)
Getting a model by type
at line 325
protected
syncModels(ModelInterface $source)
Synchronization of models