Interface

Imagine\Image\Palette\PaletteInterface

interface PaletteInterface

Constants

PALETTE_GRAYSCALE

PALETTE_RGB

PALETTE_CMYK

Methods

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

PaletteInterface useProfile(ProfileInterface $profile)

Attachs an ICC profile to this Palette.

ProfileInterface profile()

Returns the ICC profile attached to this Palette.

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

Details

at line 34
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 45
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

at line 56
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 63
public ProfileInterface profile()

Returns the ICC profile attached to this Palette.

Return Value

ProfileInterface

at line 71
public String name()

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

Return Value

String

at line 79
public array pixelDefinition()

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

Return Value

array

at line 86
public Boolean supportsAlpha()

Tells if alpha channel is supported in this palette

Return Value

Boolean