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

Public Member Functions

 __construct ($grayLevel)
 
 instructions ($stroking)
 
 getComponents ()
 
- Public Member Functions inherited from Zend_Pdf_Color
 instructions ($stroking)
 
 getComponents ()
 

Detailed Description

Definition at line 38 of file GrayScale.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $grayLevel)

Object constructor

Parameters
float$grayLevel

Definition at line 53 of file GrayScale.php.

54  {
55  if ($grayLevel < 0) { $grayLevel = 0; }
56  if ($grayLevel > 1) { $grayLevel = 1; }
57 
58  $this->_grayLevel = new Zend_Pdf_Element_Numeric($grayLevel);
59  }

Member Function Documentation

◆ getComponents()

getComponents ( )

Get color components (color space dependent)

Returns
array

Definition at line 79 of file GrayScale.php.

80  {
81  return array($this->_grayLevel->value);
82  }

◆ 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 69 of file GrayScale.php.

70  {
71  return $this->_grayLevel->toString() . ($stroking? " G\n" : " g\n");
72  }

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