\BCGColor

--------------------------------------------------------------------

Holds Color in RGB Format.


Copyright (C) Jean-Sebastien Goupil http://www.barcodephp.com

Summary

Methods
Properties
Constants
__construct()
setTransparent()
r()
g()
b()
allocate()
getColor()
No public properties found
No constants found
No protected methods found
$r
$g
$b
$transparent
N/A
No private methods found
No private properties found
N/A

Properties

$r

$r : 

Type

$g

$g : 

Type

$b

$b : 

Type

$transparent

$transparent : 

Type

Methods

__construct()

__construct() 

Save RGB value into the classes.

There are 4 way to associate color with this classes :

  1. Gives 3 parameters int (R, G, B)
  2. Gives 1 parameter string hex value (#ff0000) (preceding with #)
  3. Gives 1 parameter int hex value (0xff0000)
  4. Gives 1 parameter string color code (white, black, orange...)

setTransparent()

setTransparent(boolean  $transparent) 

Sets the color transparent.

Parameters

boolean $transparent

r()

r() : integer

Returns Red Color.

Returns

integer

g()

g() : integer

Returns Green Color.

Returns

integer

b()

b() : integer

Returns Blue Color.

Returns

integer

allocate()

allocate(resource  $im) : integer

Returns the int value for PHP color.

Parameters

resource $im

Returns

integer

getColor()

getColor(string  $code, string  $default = 'white') 

Returns class of BCGColor depending of the string color.

If the color doens't exist, it takes the default one.

Parameters

string $code
string $default