Color
in package
Pop color class
Tags
Table of Contents
Methods
- cmyk() : Cmyk
- Instantiate a CMYK color object
- grayscale() : Grayscale
- Instantiate a grayscale color object
- hex() : Hex
- Instantiate a Hex color object
- hsb() : Hsb
- Instantiate an HSB color object
- hsl() : Hsl
- Instantiate an HSL color object
- hsv() : Hsv
- Instantiate an HSV color object
- hwb() : Hwb
- Instantiate an HWB color object
- lab() : Lab
- Instantiate a CIE Lab color object
- lch() : Lch
- Instantiate a CIE LCH color object
- oklab() : Oklab
- Instantiate an Oklab color object
- oklch() : Oklch
- Instantiate an Oklch color object
- parse() : ColorInterface
- Parse color from string
- parseColorValues() : array<string|int, mixed>
- Parse color values from string
- rgb() : Rgb
- Instantiate an RGB color object
- parseCmyk() : Cmyk
- Parse a space-separated CMYK string, converting an out-of-range OutOfRangeException into the documented Color\Exception rather than letting it leak from parse()
- parseHwb() : Hwb
- Parse an HWB string, accepting either comma-separated values or native CSS Color 4 space-separated syntax (with an optional `/ alpha` suffix), converting an out-of-range or malformed-input exception into the documented Color\Exception rather than letting it leak from parse()
- parseLabFamily() : Lab|Lch|Oklab|Oklch
- Parse a Lab-family (Lab/Lch/Oklab/Oklch) string, accepting either comma-separated values or native CSS Color 4 space-separated syntax (with an optional `/ alpha` suffix), converting an out-of-range or malformed-input exception into the documented Color\Exception rather than letting it leak from parse()
Methods
cmyk()
Instantiate a CMYK color object
public
static cmyk(int $c, int $m, int $y, int $k) : Cmyk
Parameters
- $c : int
- $m : int
- $y : int
- $k : int
Return values
Cmykgrayscale()
Instantiate a grayscale color object
public
static grayscale(int $gray) : Grayscale
Parameters
- $gray : int
Return values
Grayscalehex()
Instantiate a Hex color object
public
static hex(string $hex) : Hex
Parameters
- $hex : string
Return values
Hexhsb()
Instantiate an HSB color object
public
static hsb(int $h, int $s, int $b[, float|null $a = null ]) : Hsb
Parameters
- $h : int
- $s : int
- $b : int
- $a : float|null = null
Return values
Hsbhsl()
Instantiate an HSL color object
public
static hsl(int $h, int $s, int $l[, float|null $a = null ]) : Hsl
Parameters
- $h : int
- $s : int
- $l : int
- $a : float|null = null
Return values
Hslhsv()
Instantiate an HSV color object
public
static hsv(int $h, int $s, int $v[, float|null $a = null ]) : Hsv
Parameters
- $h : int
- $s : int
- $v : int
- $a : float|null = null
Return values
Hsvhwb()
Instantiate an HWB color object
public
static hwb(int $h, int $w, int $b[, float|null $a = null ]) : Hwb
Parameters
- $h : int
- $w : int
- $b : int
- $a : float|null = null
Return values
Hwblab()
Instantiate a CIE Lab color object
public
static lab(float|string $l, float|string $a, float|string $b[, float|string|null $alpha = null ]) : Lab
Parameters
- $l : float|string
- $a : float|string
- $b : float|string
- $alpha : float|string|null = null
Return values
Lablch()
Instantiate a CIE LCH color object
public
static lch(float|string $l, float|string $c, int|string $h[, float|string|null $alpha = null ]) : Lch
Parameters
- $l : float|string
- $c : float|string
- $h : int|string
- $alpha : float|string|null = null
Return values
Lchoklab()
Instantiate an Oklab color object
public
static oklab(float|string $l, float|string $a, float|string $b[, float|string|null $alpha = null ]) : Oklab
Parameters
- $l : float|string
- $a : float|string
- $b : float|string
- $alpha : float|string|null = null
Return values
Oklaboklch()
Instantiate an Oklch color object
public
static oklch(float|string $l, float|string $c, int|string $h[, float|string|null $alpha = null ]) : Oklch
Parameters
- $l : float|string
- $c : float|string
- $h : int|string
- $alpha : float|string|null = null
Return values
Oklchparse()
Parse color from string
public
static parse(string $colorString) : ColorInterface
Parameters
- $colorString : string
Tags
Return values
ColorInterfaceparseColorValues()
Parse color values from string
public
static parseColorValues(string $colorString[, bool $comma = true ]) : array<string|int, mixed>
Parameters
- $colorString : string
- $comma : bool = true
Return values
array<string|int, mixed>rgb()
Instantiate an RGB color object
public
static rgb(int $r, int $g, int $b[, float|null $a = null ]) : Rgb
Parameters
- $r : int
- $g : int
- $b : int
- $a : float|null = null
Return values
RgbparseCmyk()
Parse a space-separated CMYK string, converting an out-of-range OutOfRangeException into the documented Color\Exception rather than letting it leak from parse()
private
static parseCmyk(string $colorString) : Cmyk
Parameters
- $colorString : string
Tags
Return values
CmykparseHwb()
Parse an HWB string, accepting either comma-separated values or native CSS Color 4 space-separated syntax (with an optional `/ alpha` suffix), converting an out-of-range or malformed-input exception into the documented Color\Exception rather than letting it leak from parse()
private
static parseHwb(string $colorString) : Hwb
Parameters
- $colorString : string
Tags
Return values
HwbparseLabFamily()
Parse a Lab-family (Lab/Lch/Oklab/Oklch) string, accepting either comma-separated values or native CSS Color 4 space-separated syntax (with an optional `/ alpha` suffix), converting an out-of-range or malformed-input exception into the documented Color\Exception rather than letting it leak from parse()
private
static parseLabFamily(string $colorString, string $class) : Lab|Lch|Oklab|Oklch
Parameters
- $colorString : string
- $class : string