Gray
in package
implements
ColorInterface
Table of Contents
Interfaces
Properties
Methods
- __construct() : mixed
- __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).
- getGray() : int
- Returns Gray value of the color (from 0 to 255).
- 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.
- setAlpha() : mixed
- Performs checks for validity of given alpha value and sets it.
- setColor() : mixed
- Performs checks for color validity (array of array(gray)).
Properties
$alpha
private
int
$alpha
$gray
private
int
$gray
$palette
private
Grayscale
$palette
Methods
__construct()
public
__construct(Grayscale $palette, array<string|int, int> $color, int $alpha) : mixed
Parameters
- $palette : Grayscale
- $color : array<string|int, int>
- $alpha : int
__toString()
Returns hex representation of the color.
public
__toString() : string
Tags
Return values
stringdarken()
Returns a copy of the current color, darkened by the specified number of shades.
public
darken(mixed $shade) : static
Parameters
- $shade : mixed
Tags
Return values
staticdissolve()
Returns a copy of current color, incrementing the alpha channel by the given amount.
public
dissolve(mixed $alpha) : static
Parameters
- $alpha : mixed
Tags
Return values
staticgetAlpha()
Returns percentage of transparency of the color (from 0 - fully transparent, to 100 - fully opaque).
public
getAlpha() : int|null
Tags
Return values
int|null —return NULL if the color type does not support transparency
getGray()
Returns Gray value of the color (from 0 to 255).
public
getGray() : int
Return values
intgetPalette()
Returns the palette attached to the current color.
public
getPalette() : PaletteInterface
Tags
Return values
PaletteInterfacegetValue()
Return the value of one of the component.
public
getValue(mixed $component) : int|null
Parameters
- $component : mixed
-
One of the ColorInterface::COLOR_* component
Tags
Return values
int|nullgrayscale()
Returns a gray related to the current color.
public
grayscale() : static
Tags
Return values
staticisOpaque()
Checks if the current color is opaque.
public
isOpaque() : bool
Tags
Return values
boollighten()
Returns a copy of the current color, lightened by the specified number of shades.
public
lighten(mixed $shade) : static
Parameters
- $shade : mixed
Tags
Return values
staticsetAlpha()
Performs checks for validity of given alpha value and sets it.
private
setAlpha(int $alpha) : mixed
Parameters
- $alpha : int
Tags
setColor()
Performs checks for color validity (array of array(gray)).
private
setColor(array<string|int, int> $color) : mixed
Parameters
- $color : array<string|int, int>