class Gray implements ColorInterface

Methods

__construct(Grayscale $palette, array $color, int $alpha)

No description

int|null
getValue(string $component)

Return the value of one of the component.

int
getGray()

Returns Gray value of the color (from 0 to 255).

getPalette()

Returns the palette attached to the current color.

int|null
getAlpha()

Returns percentage of transparency of the color (from 0 - fully transparent, to 100 - fully opaque).

dissolve(int $alpha)

Returns a copy of current color, incrementing the alpha channel by the given amount.

lighten(int $shade)

Returns a copy of the current color, lightened by the specified number of shades.

darken(int $shade)

Returns a copy of the current color, darkened by the specified number of shades.

grayscale()

Returns a gray related to the current color.

bool
isOpaque()

Checks if the current color is opaque.

string
__toString()

Returns hex representation of the color.

Details

at line 39
__construct(Grayscale $palette, array $color, int $alpha)

Parameters

Grayscale $palette
array $color
int $alpha

at line 51
int|null getValue(string $component)

Return the value of one of the component.

Parameters

string $component One of the ColorInterface::COLOR_* component

Return Value

int|null

Exceptions

InvalidArgumentException if $component is not valid

See also

ColorInterface::getValue

at line 66
int getGray()

Returns Gray value of the color (from 0 to 255).

Return Value

int

at line 76
PaletteInterface getPalette()

Returns the palette attached to the current color.

at line 86
int|null getAlpha()

Returns percentage of transparency of the color (from 0 - fully transparent, to 100 - fully opaque).

Return Value

int|null return NULL if the color type does not support transparency

See also

ColorInterface::getAlpha

at line 96
ColorInterface dissolve(int $alpha)

Returns a copy of current color, incrementing the alpha channel by the given amount.

Parameters

int $alpha

Return Value

ColorInterface

Exceptions

RuntimeException if the color type does not support transparency

See also

ColorInterface::dissolve

at line 109
ColorInterface lighten(int $shade)

Returns a copy of the current color, lightened by the specified number of shades.

Parameters

int $shade

Return Value

ColorInterface

See also

ColorInterface::lighten

at line 119
ColorInterface darken(int $shade)

Returns a copy of the current color, darkened by the specified number of shades.

Parameters

int $shade

Return Value

ColorInterface

See also

ColorInterface::darken

at line 129
ColorInterface grayscale()

Returns a gray related to the current color.

at line 139
bool isOpaque()

Checks if the current color is opaque.

Return Value

bool

See also

ColorInterface::isOpaque

at line 149
string __toString()

Returns hex representation of the color.

Return Value

string

See also

ColorInterface::__toString