Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
Zend_Pdf_Color_Cmyk Class Reference
Inheritance diagram for Zend_Pdf_Color_Cmyk:
Zend_Pdf_Color

Public Member Functions

 __construct ($c, $m, $y, $k)
 
 instructions ($stroking)
 
 getComponents ()
 
- Public Member Functions inherited from Zend_Pdf_Color
 instructions ($stroking)
 
 getComponents ()
 

Detailed Description

Definition at line 37 of file Cmyk.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $c,
  $m,
  $y,
  $k 
)

Object constructor

Parameters
float$c
float$m
float$y
float$k

Definition at line 80 of file Cmyk.php.

81  {
82  if ($c < 0) { $c = 0; }
83  if ($c > 1) { $c = 1; }
84 
85  if ($m < 0) { $m = 0; }
86  if ($m > 1) { $m = 1; }
87 
88  if ($y < 0) { $y = 0; }
89  if ($y > 1) { $y = 1; }
90 
91  if ($k < 0) { $k = 0; }
92  if ($k > 1) { $k = 1; }
93 
94  $this->_c = new Zend_Pdf_Element_Numeric($c);
95  $this->_m = new Zend_Pdf_Element_Numeric($m);
96  $this->_y = new Zend_Pdf_Element_Numeric($y);
97  $this->_k = new Zend_Pdf_Element_Numeric($k);
98  }

Member Function Documentation

◆ getComponents()

getComponents ( )

Get color components (color space dependent)

Returns
array

Definition at line 121 of file Cmyk.php.

122  {
123  return array($this->_c->value, $this->_m->value, $this->_y->value, $this->_k->value);
124  }

◆ instructions()

instructions (   $stroking)

Instructions, which can be directly inserted into content stream to switch color. Color set instructions differ for stroking and nonstroking operations.

Parameters
boolean$stroking
Returns
string

Definition at line 108 of file Cmyk.php.

109  {
110  return $this->_c->toString() . ' '
111  . $this->_m->toString() . ' '
112  . $this->_y->toString() . ' '
113  . $this->_k->toString() . ($stroking? " K\n" : " k\n");
114  }

The documentation for this class was generated from the following file: