\Securimage_Color

Color object for Securimage CAPTCHA

Summary

Methods
Properties
Constants
__construct()
$r
$g
$b
No constants found
constructRGB()
constructHTML()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$r

$r : int

Red value (0-255)

Type

int

$g

$g : int

Gree value (0-255)

Type

int

$b

$b : int

Blue value (0-255)

Type

int

Methods

__construct()

__construct(string $color)

Create a new Securimage_Color object.

Constructor expects 1 or 3 arguments.

When passing a single argument, specify the color using HTML hex format.

When passing 3 arguments, specify each RGB component (from 0-255) individually.

Examples:

$color = new Securimage_Color('#0080FF');
$color = new Securimage_Color(0, 128, 255);

Parameters

string $color

The html color code to use

Throws

\Exception

If any color value is not valid

constructRGB()

constructRGB(int $red, int $green, int $blue)

Construct from an rgb triplet

Parameters

int $red

The red component, 0-255

int $green

The green component, 0-255

int $blue

The blue component, 0-255

constructHTML()

constructHTML(string $color)

Construct from an html hex color code

Parameters

string $color