Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Cmyk.php
Go to the documentation of this file.
1 <?php
23 #require_once 'Zend/Pdf/Element/Numeric.php';
24 
25 
27 #require_once 'Zend/Pdf/Color.php';
28 
38 {
45  private $_c;
46 
53  private $_m;
54 
61  private $_y;
62 
69  private $_k;
70 
71 
80  public function __construct($c, $m, $y, $k)
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  }
99 
108  public function instructions($stroking)
109  {
110  return $this->_c->toString() . ' '
111  . $this->_m->toString() . ' '
112  . $this->_y->toString() . ' '
113  . $this->_k->toString() . ($stroking? " K\n" : " k\n");
114  }
115 
121  public function getComponents()
122  {
123  return array($this->_c->value, $this->_m->value, $this->_y->value, $this->_k->value);
124  }
125 }
126 
__construct($c, $m, $y, $k)
Definition: Cmyk.php:80
instructions($stroking)
Definition: Cmyk.php:108