Grayscale
in package
implements
PaletteInterface
The grayscale palette.
Table of Contents
Interfaces
- PaletteInterface
- Interface that any palette must implement.
Properties
- $colors : array<string|int, Gray>
- $parser : ColorParser
- $profile : ProfileInterface|null
Methods
- __construct() : mixed
- blend() : ColorInterface
- Blend two colors given an amount.
- color() : ColorInterface
- Returns a color given some values.
- getChannelsMaxValue() : int
- Get the max value of palette components (255 for RGB and Grayscale, 100 for CMYK).
- name() : string
- Returns the name of this Palette, one of PaletteInterface::PALETTE_ constants.
- pixelDefinition() : array<string|int, string>
- Returns an array containing ColorInterface::COLOR_* constants that define the structure of colors for a pixel.
- profile() : ProfileInterface
- Returns the ICC profile attached to this Palette.
- supportsAlpha() : bool
- Tells if alpha channel is supported in this palette.
- useProfile() : $this
- Attachs an ICC profile to this Palette.
Properties
$colors
protected
static array<string|int, Gray>
$colors
= array()
$parser
private
ColorParser
$parser
$profile
private
ProfileInterface|null
$profile
Methods
__construct()
public
__construct() : mixed
blend()
Blend two colors given an amount.
public
blend(ColorInterface $color1, ColorInterface $color2, mixed $amount) : ColorInterface
Parameters
- $color1 : ColorInterface
- $color2 : ColorInterface
- $amount : mixed
-
The amount of color2 in color1
Tags
Return values
ColorInterfacecolor()
Returns a color given some values.
public
color(mixed $color[, mixed $alpha = null ]) : ColorInterface
Parameters
- $color : mixed
-
A color
- $alpha : mixed = null
-
Set alpha to null to disable it
Tags
Return values
ColorInterfacegetChannelsMaxValue()
Get the max value of palette components (255 for RGB and Grayscale, 100 for CMYK).
public
getChannelsMaxValue() : int
Tags
Return values
intname()
Returns the name of this Palette, one of PaletteInterface::PALETTE_ constants.
public
name() : string
Tags
Return values
stringpixelDefinition()
Returns an array containing ColorInterface::COLOR_* constants that define the structure of colors for a pixel.
public
pixelDefinition() : array<string|int, string>
Tags
Return values
array<string|int, string>profile()
Returns the ICC profile attached to this Palette.
public
profile() : ProfileInterface
Tags
Return values
ProfileInterfacesupportsAlpha()
Tells if alpha channel is supported in this palette.
public
supportsAlpha() : bool
Tags
Return values
booluseProfile()
Attachs an ICC profile to this Palette.
public
useProfile(ProfileInterface $profile) : $this
Parameters
- $profile : ProfileInterface