class TCPDF_COLORS (View source)

Properties

static $webcolor

Array of WEB safe colors

static $jscolor

Array of valid JavaScript color names

static $spotcolor

Array of Spot colors (C,M,Y,K,name) Color keys must be in lowercase and without spaces.

Methods

static array|false
getSpotColor(string $name, array $spotc)

Return the Spot color array.

static array|false
convertHTMLColorToDec(string $hcolor, array $spotc, array $defcol = array('R' => 128, 'G' => 128, 'B' => 128))

Returns an array (RGB or CMYK) from an html color name, or a six-digit (i.e. #3FE5AA), or three-digit (i.e. #7FF) hexadecimal color, or a javascript color array, or javascript color name.

static string
getColorStringFromArray(array $c)

Convert a color array into a string representation.

static 
_JScolor(string $color)

Convert color to javascript color.

Details

static array|false getSpotColor(string $name, array $spotc)

Since: 5.9.125 (2011-10-03)

Return the Spot color array.

Parameters

string $name

Name of the spot color.

array $spotc

Reference to an array of spot colors.

Return Value

array|false

Spot color array or false if not defined.

static array|false convertHTMLColorToDec(string $hcolor, array $spotc, array $defcol = array('R' => 128, 'G' => 128, 'B' => 128))

Returns an array (RGB or CMYK) from an html color name, or a six-digit (i.e. #3FE5AA), or three-digit (i.e. #7FF) hexadecimal color, or a javascript color array, or javascript color name.

Parameters

string $hcolor

HTML color.

array $spotc

Reference to an array of spot colors.

array $defcol

Color to return in case of error.

Return Value

array|false

RGB or CMYK color, or false in case of error.

static string getColorStringFromArray(array $c)

Since: 5.9.137 (2011-12-01)

Convert a color array into a string representation.

Parameters

array $c

Array of colors.

Return Value

string

The color array representation.

static protected _JScolor(string $color)

Since: 2.1.002 (2008-02-12)

Convert color to javascript color.

Parameters

string $color

color name or "#RRGGBB"