\BarcodeBakery\CommonBCGColor

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

$g

$g

$b

$b

$transparent

$transparent

Methods

__construct()

__construct() : mixed

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...)

Returns

mixed —

setTransparent()

setTransparent(bool  $transparent) : mixed

Sets the color transparent.

Parameters

bool $transparent

Returns

mixed —

r()

r() : int

Returns Red Color.

Returns

int —

g()

g() : int

Returns Green Color.

Returns

int —

b()

b() : int

Returns Blue Color.

Returns

int —

allocate()

allocate(resource  $im) : int

Returns the int value for PHP color.

Parameters

resource $im

Returns

int —

getColor()

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

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

Returns

mixed —