ColorInterface
in
Table of Contents
Constants
- COLOR_BLUE = 'blue'
- Channel name: blue.
- COLOR_CYAN = 'cyan'
- Channel name: cyan.
- COLOR_GRAY = 'gray'
- Channel name: gray.
- COLOR_GREEN = 'green'
- Channel name: green.
- COLOR_KEYLINE = 'keyline'
- Channel name: key (black).
- COLOR_MAGENTA = 'magenta'
- Channel name: magenta.
- COLOR_RED = 'red'
- Channel name: red.
- COLOR_YELLOW = 'yellow'
- Channel name: yellow.
Methods
- __toString() : string
- Returns hex representation of the color.
- darken() : static
- Returns a copy of the current color, darkened by the specified number of shades.
- dissolve() : static
- Returns a copy of current color, incrementing the alpha channel by the given amount.
- getAlpha() : int|null
- Returns percentage of transparency of the color (from 0 - fully transparent, to 100 - fully opaque).
- getPalette() : PaletteInterface
- Returns the palette attached to the current color.
- getValue() : int|null
- Return the value of one of the component.
- grayscale() : static
- Returns a gray related to the current color.
- isOpaque() : bool
- Checks if the current color is opaque.
- lighten() : static
- Returns a copy of the current color, lightened by the specified number of shades.
Constants
COLOR_BLUE
Channel name: blue.
public
string
COLOR_BLUE
= 'blue'
COLOR_CYAN
Channel name: cyan.
public
string
COLOR_CYAN
= 'cyan'
COLOR_GRAY
Channel name: gray.
public
string
COLOR_GRAY
= 'gray'
COLOR_GREEN
Channel name: green.
public
string
COLOR_GREEN
= 'green'
COLOR_KEYLINE
Channel name: key (black).
public
string
COLOR_KEYLINE
= 'keyline'
COLOR_MAGENTA
Channel name: magenta.
public
string
COLOR_MAGENTA
= 'magenta'
COLOR_RED
Channel name: red.
public
string
COLOR_RED
= 'red'
COLOR_YELLOW
Channel name: yellow.
public
string
COLOR_YELLOW
= 'yellow'
Methods
__toString()
Returns hex representation of the color.
public
__toString() : string
Return values
stringdarken()
Returns a copy of the current color, darkened by the specified number of shades.
public
darken(int $shade) : static
Parameters
- $shade : int
Return values
staticdissolve()
Returns a copy of current color, incrementing the alpha channel by the given amount.
public
dissolve(int $alpha) : static
Parameters
- $alpha : int
Tags
Return values
staticgetAlpha()
Returns percentage of transparency of the color (from 0 - fully transparent, to 100 - fully opaque).
public
getAlpha() : int|null
Return values
int|null —return NULL if the color type does not support transparency
getPalette()
Returns the palette attached to the current color.
public
getPalette() : PaletteInterface
Return values
PaletteInterfacegetValue()
Return the value of one of the component.
public
getValue(string $component) : int|null
Parameters
- $component : string
-
One of the ColorInterface::COLOR_* component
Tags
Return values
int|nullgrayscale()
Returns a gray related to the current color.
public
grayscale() : static
Return values
staticisOpaque()
Checks if the current color is opaque.
public
isOpaque() : bool
Return values
boollighten()
Returns a copy of the current color, lightened by the specified number of shades.
public
lighten(int $shade) : static
Parameters
- $shade : int