SetaPDF_Core_DataStructure_Color_Rgb RGB Color

File: /SetaPDF v2/Core/DataStructure/Color/Rgb.php

Class hierarchy

Implements

Summary

Properties

$_components

The array of color components


Static Methods

createByComponents()

public static SetaPDF_Core_DataStructure_Color::createByComponents (
$components
):

Create an instance by a PDF array object, PHP array or a hexadecimal string of an RGB value.

Parameters
$components
 
Exceptions

Throws InvalidArgumentException

hexToRgb()

public static SetaPDF_Core_DataStructure_Color::hexToRgb (
$hex
):

Converts a hex encoded string into a component array of red, green and blue values.

Parameters
$hex
 

writePdfString()

public static SetaPDF_Core_DataStructure_Color_Rgb::writePdfString (
SetaPDF_Core_WriteInterface $writer, $componentsOrR [, $strokingOrG = 0.0 [, $b = 0.0 [, $stroking = true ]]]
): void

Writes a color definition directly to a writer.

Parameters
$writer : SetaPDF_Core_WriteInterface
 
$componentsOrR

An array of 3 components or the value for the red component

$strokingOrG

Stroking flag or the value for the green component

$b

The value for the blue component

$stroking

Stroking flag

Exceptions

Throws InvalidArgumentException

writePdfStringByComponents()

public static SetaPDF_Core_DataStructure_Color::writePdfStringByComponents (
SetaPDF_Core_WriteInterface $writer, $components [, $stroking = true ]
): void

Writes a color definition directly to a writer.

Parameters
$writer : SetaPDF_Core_WriteInterface
 
$components
 
$stroking
 
Exceptions

Throws InvalidArgumentException


Methods

__construct()

public SetaPDF_Core_DataStructure_Color_Rgb::__construct (
$componentsOrR [, $g = 0.0 [, $b = 0.0 ]]
)

The constructor.

Parameters
$componentsOrR
 
$g
 
$b
 
Exceptions

Throws InvalidArgumentException

__clone()

Implementation of __clone().

adjustAllComponents()

Adjust all color components by a specific value.

Parameters
$by
 

draw()

public SetaPDF_Core_DataStructure_Color_Rgb::draw (
SetaPDF_Core_WriteInterface $writer [, $stroking = true ]
): void

Draw the color on a writer.

Parameters
$writer : SetaPDF_Core_WriteInterface
 
$stroking
 
See

getValue()

Get the components of the color.

toPhp()

Get the data as a PHP value.