RgbColor
in package
implements
ColorInterface
FinalYes
RGB color with components in 0.0–1.0 range — maps to PDF DeviceRGB.
Factory methods fromInt() and fromHex() accept the more common
0–255 and #RRGGBB formats and normalize to the PDF float range.
Table of Contents
Interfaces
- ColorInterface
- Common contract for PDF color operands — used by ContentStream color operators.
Properties
Methods
- __construct() : mixed
- fromHex() : self
- fromInt() : self
- getColorSpace() : string
- toArray() : array<int, float>
- toCmyk() : CmykColor
- toGray() : GrayColor
Properties
$b read-only
public
float
$b
$g read-only
public
float
$g
$r read-only
public
float
$r
Methods
__construct()
public
__construct(float $r, float $g, float $b) : mixed
Parameters
- $r : float
- $g : float
- $b : float
fromHex()
public
static fromHex(string $hex) : self
Parameters
- $hex : string
Return values
selffromInt()
public
static fromInt(int $r, int $g, int $b) : self
Parameters
- $r : int
- $g : int
- $b : int
Return values
selfgetColorSpace()
public
getColorSpace() : string
Return values
stringtoArray()
public
toArray() : array<int, float>
Return values
array<int, float>toCmyk()
public
toCmyk() : CmykColor
Return values
CmykColortoGray()
public
toGray() : GrayColor