AbstractLayer
in package
implements
LayerInterface
Abstract cover layer
Tags
Interfaces, Classes, Traits and Enums
- LayerInterface
- Cover layer interface
Table of Contents
- $colorMap : array<string|int, mixed>
- Mapping of color names to RGB values.
- getColor() : int|false
- Check and allocates color
- getHSBColor() : int
- Using HSB allows us to control the contrast while allowing randomness
Properties
$colorMap
Mapping of color names to RGB values.
protected
array<string|int, mixed>
$colorMap
= ['black' => [0, 0, 0], 'silver' => [192, 192, 192], 'gray' => [128, 128, 128], 'white' => [255, 255, 255], 'maroon' => [128, 0, 0], 'red' => [255, 0, 0], 'purple' => [128, 0, 128], 'fuchsia' => [255, 0, 255], 'green' => [0, 128, 0], 'lime' => [0, 255, 0], 'olive' => [128, 128, 0], 'yellow' => [255, 255, 0], 'navy' => [0, 0, 128], 'blue' => [0, 0, 255], 'teal' => [0, 128, 128], 'aqua' => [0, 255, 255]]
Methods
getColor()
Check and allocates color
protected
getColor(resource $im, string $color) : int|false
Parameters
- $im : resource
-
Image resource being updated
- $color : string
-
Legal color name from HTML4
Return values
int|false —allocated color
getHSBColor()
Using HSB allows us to control the contrast while allowing randomness
protected
getHSBColor(resource $im, int $h, int $s, int $v) : int
Parameters
- $im : resource
-
Active image resource
- $h : int
-
Hue (0-255)
- $s : int
-
Saturation (0-255)
- $v : int
-
Lightness (0-255)