Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
TCPDF_COLORS Class Reference

PHP color class for TCPDF .. More...

Static Public Member Functions

static _JScolor ($color)
 Convert color to javascript color.
 
static convertHTMLColorToDec ($hcolor, &$spotc, $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.
 
static getColorStringFromArray ($c)
 Convert a color array into a string representation.
 
static getSpotColor ($name, &$spotc)
 Return the Spot color array.
 

Static Public Attributes

static $jscolor = array ('transparent', 'black', 'white', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'dkGray', 'gray', 'ltGray')
 Array of valid JavaScript color names static.
 
static $spotcolor
 Array of Spot colors (C,M,Y,K,name) Color keys must be in lowercase and without spaces.
 
static $webcolor
 Array of WEB safe colors static.
 

Detailed Description

PHP color class for TCPDF ..

Version
1.0.004
Author
Nicola Asuni - info@.nosp@m.tecn.nosp@m.ick.c.nosp@m.om

Member Function Documentation

◆ _JScolor()

static TCPDF_COLORS::_JScolor ( $color)
static

Convert color to javascript color.

Parameters
string$colorcolor name or "#RRGGBB"
Since
2.1.002 (2008-02-12) static

◆ convertHTMLColorToDec()

static TCPDF_COLORS::convertHTMLColorToDec ( $hcolor,
& $spotc,
$defcol = array('R'=>128,'G'=>128,'B'=>128) )
static

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$hcolorHTML color.
array$spotcReference to an array of spot colors.
array$defcolColor to return in case of error.
Return values
array|falseRGB or CMYK color, or false in case of error. static

◆ getColorStringFromArray()

static TCPDF_COLORS::getColorStringFromArray ( $c)
static

Convert a color array into a string representation.

Parameters
array$cArray of colors.
Return values
stringThe color array representation.
Since
5.9.137 (2011-12-01) static

◆ getSpotColor()

static TCPDF_COLORS::getSpotColor ( $name,
& $spotc )
static

Return the Spot color array.

Parameters
string$nameName of the spot color.
array$spotcReference to an array of spot colors.
Return values
array|falseSpot color array or false if not defined.
Since
5.9.125 (2011-10-03) static

Member Data Documentation

◆ $spotcolor

TCPDF_COLORS::$spotcolor
static
Initial value:
= array (
'none' => array( 0, 0, 0, 0, 'None'),
'all' => array(100, 100, 100, 100, 'All'),
'cyan' => array(100, 0, 0, 0, 'Cyan'),
'magenta' => array( 0, 100, 0, 0, 'Magenta'),
'yellow' => array( 0, 0, 100, 0, 'Yellow'),
'key' => array( 0, 0, 0, 100, 'Key'),
'white' => array( 0, 0, 0, 0, 'White'),
'black' => array( 0, 0, 0, 100, 'Black'),
'red' => array( 0, 100, 100, 0, 'Red'),
'green' => array(100, 0, 100, 0, 'Green'),
'blue' => array(100, 100, 0, 0, 'Blue'),
)

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

As long as no open standard for spot colours exists, you have to buy a colour book by one of the colour manufacturers and insert the values and names of spot colours directly. Common industry standard spot colors are: ANPA-COLOR, DIC, FOCOLTONE, GCMI, HKS, PANTONE, TOYO, TRUMATCH. static


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