Class

Imagine\Image\Palette\Color\Gray

class Gray implements ColorInterface

Methods

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

Integer getValue(string $component)

Return the value of one of the component.

integer getGray()

Returns Gray value of the color

PaletteInterface getPalette()

Returns the palette attached to the current color

integer getAlpha()

Returns percentage of transparency of the color

ColorInterface dissolve(integer $alpha)

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

ColorInterface lighten(integer $shade)

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

ColorInterface darken(integer $shade)

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

ColorInterface grayscale()

Returns a gray related to the current color

Boolean isOpaque()

Checks if the current color is opaque

string __toString()

Returns hex representation of the color

Details

at line 35
public __construct(Grayscale $palette, array $color, $alpha)

Parameters

Grayscale $palette
array $color
$alpha

at line 45
public Integer getValue(string $component)

Return the value of one of the component.

Parameters

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

Return Value

Integer

at line 60
public integer getGray()

Returns Gray value of the color

Return Value

integer

at line 68
public PaletteInterface getPalette()

Returns the palette attached to the current color

Return Value

PaletteInterface

at line 76
public integer getAlpha()

Returns percentage of transparency of the color

Return Value

integer

at line 84
public ColorInterface dissolve(integer $alpha)

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

Parameters

integer $alpha

Return Value

ColorInterface

at line 94
public ColorInterface lighten(integer $shade)

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

Parameters

integer $shade

Return Value

ColorInterface

at line 102
public ColorInterface darken(integer $shade)

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

Parameters

integer $shade

Return Value

ColorInterface

at line 110
public ColorInterface grayscale()

Returns a gray related to the current color

Return Value

ColorInterface

at line 118
public Boolean isOpaque()

Checks if the current color is opaque

Return Value

Boolean

at line 128
public string __toString()

Returns hex representation of the color

Return Value

string