Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
GrayScale.php
Go to the documentation of this file.
1 <?php
24 #require_once 'Zend/Pdf/Element/Numeric.php';
25 
26 
28 #require_once 'Zend/Pdf/Color.php';
29 
39 {
46  private $_grayLevel;
47 
53  public function __construct($grayLevel)
54  {
55  if ($grayLevel < 0) { $grayLevel = 0; }
56  if ($grayLevel > 1) { $grayLevel = 1; }
57 
58  $this->_grayLevel = new Zend_Pdf_Element_Numeric($grayLevel);
59  }
60 
69  public function instructions($stroking)
70  {
71  return $this->_grayLevel->toString() . ($stroking? " G\n" : " g\n");
72  }
73 
79  public function getComponents()
80  {
81  return array($this->_grayLevel->value);
82  }
83 }
84 
__construct($grayLevel)
Definition: GrayScale.php:53