Class

Imagine\Image\Palette\Grayscale

class Grayscale implements PaletteInterface

Methods

__construct()

String name()

Returns the name of this Palette, one of PaletteInterface::PALETTE_* constants

array pixelDefinition()

Returns an array containing ColorInterface::COLOR_* constants that define the structure of colors for a pixel.

Boolean supportsAlpha()

Tells if alpha channel is supported in this palette

PaletteInterface useProfile(ProfileInterface $profile)

Attachs an ICC profile to this Palette.

ProfileInterface profile()

Returns the ICC profile attached to this Palette.

ColorInterface color(string|array|integer $color, integer|null $alpha = null)

Returns a color given some values

ColorInterface blend(ColorInterface $color1, ColorInterface $color2, float $amount)

Blend two colors given an amount

Details

at line 37
public __construct()

at line 45
public String name()

Returns the name of this Palette, one of PaletteInterface::PALETTE_* constants

Return Value

String

at line 53
public array pixelDefinition()

Returns an array containing ColorInterface::COLOR_* constants that define the structure of colors for a pixel.

Return Value

array

at line 61
public Boolean supportsAlpha()

Tells if alpha channel is supported in this palette

Return Value

Boolean

at line 69
public PaletteInterface useProfile(ProfileInterface $profile)

Attachs an ICC profile to this Palette.

(A default profile is provided by default)

Parameters

ProfileInterface $profile

Return Value

PaletteInterface

at line 79
public ProfileInterface profile()

Returns the ICC profile attached to this Palette.

Return Value

ProfileInterface

at line 91
public ColorInterface color(string|array|integer $color, integer|null $alpha = null)

Returns a color given some values

Parameters

string|array|integer $color A color
integer|null $alpha Set alpha to null to disable it

Return Value

ColorInterface

Exceptions

InvalidArgumentException In case you pass an alpha value to a Palette that does not support alpha

at line 110
public ColorInterface blend(ColorInterface $color1, ColorInterface $color2, float $amount)

Blend two colors given an amount

Parameters

ColorInterface $color1
ColorInterface $color2
float $amount The amount of color2 in color1

Return Value

ColorInterface