HEX
class HEX extends Model implements ModelInterface
Traits
Properties
| protected array | $channels | ||
| protected array | $types | ||
| protected float | $alpha | from Model | |
| protected string | $hex | ||
| protected string | $hexa |
Methods
void
set(string|array $value)
Set all model channels
int|float
limitation(int|float $value, int $max, int $min = 0)
Limitation of a variable in the range
from Model
string|stdClass
convertToRgb(bool $withAlpha = false, bool $toString = false)
Convert instance values to RGB
void
convertFromRgb(string|array $rgb)
Convert instance values from RGB
void
setChannel(string $channel, string|integer|float $value)
Set single channel
float|integer|string
getChannel(string $channel)
Get single channel
Details
in Model at line 23
void
__construct(string $value = NULL)
in Model at line 43
array
getChannelsList()
in Model at line 51
array
getTypesList()
in Model at line 61
void
syncAlpha(string|float $alpha)
in Model at line 76
boolean
isType(string $type)
in Model at line 86
boolean
isChannel(string $channel)
at line 114
void
set(string|array $value)
Set all model channels
in Model at line 110
protected int|float
limitation(int|float $value, int $max, int $min = 0)
Limitation of a variable in the range
in HexTrait at line 18
protected string
RgbToHex(string $rgb, bool $withAlpha = true)
Converting rgb to hex code
in HexTrait at line 50
protected int
strToDec(string $value)
Converting hex code to decimal number
in HexTrait at line 69
protected string
decToHex(int $value)
Converting decimal number to hex code string
in HexTrait at line 86
protected array
parseHex(string $value)
in HexTrait at line 128
protected array
explodeHex(string $value)
at line 36
string|stdClass
convertToRgb(bool $withAlpha = false, bool $toString = false)
Convert instance values to RGB
at line 66
void
convertFromRgb(string|array $rgb)
Convert instance values from RGB
at line 80
void
setChannel(string $channel, string|integer|float $value)
Set single channel
at line 96
float|integer|string
getChannel(string $channel)
Get single channel
at line 135
string|stdClass
get(bool $withAlpha = false, bool $toString = false)
Get all model channels