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

Public Member Functions

 __construct ($r, $g, $b)
 
 instructions ($stroking)
 
 getComponents ()
 
- Public Member Functions inherited from Zend_Pdf_Color
 instructions ($stroking)
 
 getComponents ()
 

Detailed Description

Definition at line 38 of file Rgb.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $r,
  $g,
  $b 
)

Object constructor

Parameters
float$r
float$g
float$b

Clamp values to legal limits.

Definition at line 72 of file Rgb.php.

73  {
75  if ($r < 0) { $r = 0; }
76  if ($r > 1) { $r = 1; }
77 
78  if ($g < 0) { $g = 0; }
79  if ($g > 1) { $g = 1; }
80 
81  if ($b < 0) { $b = 0; }
82  if ($b > 1) { $b = 1; }
83 
84  $this->_r = new Zend_Pdf_Element_Numeric($r);
85  $this->_g = new Zend_Pdf_Element_Numeric($g);
86  $this->_b = new Zend_Pdf_Element_Numeric($b);
87  }

Member Function Documentation

◆ getComponents()

getComponents ( )

Get color components (color space dependent)

Returns
array

Definition at line 109 of file Rgb.php.

110  {
111  return array($this->_r->value, $this->_g->value, $this->_b->value);
112  }

◆ 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 97 of file Rgb.php.

98  {
99  return $this->_r->toString() . ' '
100  . $this->_g->toString() . ' '
101  . $this->_b->toString() . ($stroking? " RG\n" : " rg\n");
102  }

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