class Color (View source)

An object representation of a color.

Properties

protected int|null $index
protected int $red
protected int $green
protected int $blue
protected int|null $alpha

Methods

__construct(int $red, int $green, int $blue, int|null $alpha = null, int|null $index = null)

Color constructor.

static Color
transparent()

Shortcut to create a transparent color.

static Color
white()

Shortcut to create a white color.

int
getRed()

No description

int
getGreen()

No description

int
getBlue()

No description

int|null
getAlpha()

No description

int|null
getIndex()

No description

Details

__construct(int $red, int $green, int $blue, int|null $alpha = null, int|null $index = null)

Color constructor.

Parameters

int $red Value of red component (between 0 and 255)
int $green Value of green component (between 0 and 255)
int $blue Value of blue component (between 0 and 255)
int|null $alpha Optional value of alpha component (between 0 and 127). 0 = opaque, 127 = transparent.
int|null $index Index of the color for the image resource

static Color transparent()

Shortcut to create a transparent color.

Return Value

Color

static Color white()

Shortcut to create a white color.

Return Value

Color

int getRed()

Return Value

int

int getGreen()

Return Value

int

int getBlue()

Return Value

int

int|null getAlpha()

Return Value

int|null

int|null getIndex()

Return Value

int|null