setasign\SetaPDF2\Core\DataStructure\Color
Cmyk CMYK Color
File: /SetaPDF v2/Core/DataStructure/Color/Cmyk.php
Old class name (alias):
\SetaPDF_Core_DataStructure_Color_Cmyk
Class hierarchy
Implements
Summary
Properties
Static Methods
createByComponents()
Create an instance by a PDF array object, PHP array or a hexadecimal string of an RGB value.
Parameters
- $components: int|float|string|array|\setasign\SetaPDF2\Core\Type\PdfArray
Exceptions
Throws \InvalidArgumentException
hexToRgb()
WARNING: This method is marked as deprecated!
Use Rgb::hexToRgb() instead.
Converts a hex encoded string (3 or 6 characters) into a component array of red, green and blue values.
Parameters
- $hex: string
writePdfString()
array|float $componentsOrC,
bool|float $strokingOrM = 0.0,
float $y = 0.0,
float $k = 0.0,
bool $stroking = true
Writes a color definition directly to a writer.
Parameters
- $writer: \setasign\SetaPDF2\Core\Writer\WriteInterface
- $componentsOrC: array|float
An array of 4 components or the value for the cyan component
- $strokingOrM: bool|float
Stroking flag or the value for the magenta component
- $y: float
The value for the yellow component
- $k: float
The value for the black component
- $stroking: bool
Stroking flag
Exceptions
Throws \InvalidArgumentException
writePdfStringByComponents()
array|int|float|string $components,
bool $stroking = true
Writes a color definition directly to a writer.
Parameters
- $writer: \setasign\SetaPDF2\Core\Writer\WriteInterface
- $components: array|int|float|string
- $stroking: bool
Exceptions
Throws \InvalidArgumentException
Methods
__construct()
float $m = 0.0,
float $y = 0.0,
float $k = 0.0
The constructor.
Parameters
- $componentsOrC: \setasign\SetaPDF2\Core\Type\PdfArray|array|float
- $m: float
- $y: float
- $k: float
Exceptions
Throws \InvalidArgumentException
draw()
Draw the color on a writer.
Parameters
- $writer: \setasign\SetaPDF2\Core\Writer\WriteInterface
- $stroking: bool
