PaletteInterface
in
Interface that any palette must implement.
Table of Contents
Constants
- PALETTE_CMYK = 'cmyk'
- Palette name: CMYK.
- PALETTE_GRAYSCALE = 'gray'
- Palette name: grayscale.
- PALETTE_RGB = 'rgb'
- Palette name: RGB.
Methods
- 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.
Constants
PALETTE_CMYK
Palette name: CMYK.
public
string
PALETTE_CMYK
= 'cmyk'
PALETTE_GRAYSCALE
Palette name: grayscale.
public
string
PALETTE_GRAYSCALE
= 'gray'
PALETTE_RGB
Palette name: RGB.
public
string
PALETTE_RGB
= 'rgb'
Methods
blend()
Blend two colors given an amount.
public
blend(ColorInterface $color1, ColorInterface $color2, float $amount) : ColorInterface
Parameters
- $color1 : ColorInterface
- $color2 : ColorInterface
- $amount : float
-
The amount of color2 in color1
Return values
ColorInterfacecolor()
Returns a color given some values.
public
color(string|array<string|int, int>|int $color[, int|null $alpha = null ]) : ColorInterface
Parameters
- $color : string|array<string|int, int>|int
-
A color
- $alpha : int|null = 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
Return values
intname()
Returns the name of this Palette, one of PaletteInterface::PALETTE_ constants.
public
name() : string
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>
Return values
array<string|int, string>profile()
Returns the ICC profile attached to this Palette.
public
profile() : ProfileInterface
Return values
ProfileInterfacesupportsAlpha()
Tells if alpha channel is supported in this palette.
public
supportsAlpha() : bool
Return values
booluseProfile()
Attachs an ICC profile to this Palette.
public
useProfile(ProfileInterface $profile) : $this
(A default profile is provided by default)
Parameters
- $profile : ProfileInterface