class Grayscale implements PaletteInterface

The grayscale palette.

Properties

static protected Gray[] $colors

Methods

__construct()

No description

string
name()

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

string[]
pixelDefinition()

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

bool
supportsAlpha()

Tells if alpha channel is supported in this palette.

int
getChannelsMaxValue()

Get the max value of palette components (255 for RGB and Grayscale, 100 for CMYK).

$this
useProfile(ProfileInterface $profile)

Attachs an ICC profile to this Palette.

profile()

Returns the ICC profile attached to this Palette.

color(string|int[]|int $color, int|null $alpha = null)

Returns a color given some values.

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

Blend two colors given an amount.

Details

at line 40
__construct()

at line 50
string name()

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

Return Value

string

See also

PaletteInterface::name

at line 60
string[] pixelDefinition()

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

Return Value

string[]

See also

PaletteInterface::pixelDefinition

at line 70
bool supportsAlpha()

Tells if alpha channel is supported in this palette.

Return Value

bool

See also

PaletteInterface::supportsAlpha

at line 80
int getChannelsMaxValue()

Get the max value of palette components (255 for RGB and Grayscale, 100 for CMYK).

Return Value

int

See also

PaletteInterface::getChannelsMaxValue

at line 90
$this useProfile(ProfileInterface $profile)

Attachs an ICC profile to this Palette.

(A default profile is provided by default)

Parameters

ProfileInterface $profile

Return Value

$this

See also

PaletteInterface::useProfile

at line 102
ProfileInterface profile()

Returns the ICC profile attached to this Palette.

at line 116
ColorInterface color(string|int[]|int $color, int|null $alpha = null)

Returns a color given some values.

Parameters

string|int[]|int $color A color
int|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

See also

PaletteInterface::color

at line 137
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

See also

PaletteInterface::blend