HumHub Documentation (unofficial)

ColorInterface

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_YELLOW

Channel name: yellow.

public string COLOR_YELLOW = 'yellow'

Methods

__toString()

Returns hex representation of the color.

public __toString() : string
Return values
string

darken()

Returns a copy of the current color, darkened by the specified number of shades.

public darken(int $shade) : static
Parameters
$shade : int
Return values
static

dissolve()

Returns a copy of current color, incrementing the alpha channel by the given amount.

public dissolve(int $alpha) : static
Parameters
$alpha : int
Tags
throws
RuntimeException

if the color type does not support transparency

Return values
static

getAlpha()

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

getValue()

Return the value of one of the component.

public getValue(string $component) : int|null
Parameters
$component : string

One of the ColorInterface::COLOR_* component

Tags
throws
InvalidArgumentException

if $component is not valid

Return values
int|null

grayscale()

Returns a gray related to the current color.

public grayscale() : static
Return values
static

isOpaque()

Checks if the current color is opaque.

public isOpaque() : bool
Return values
bool

lighten()

Returns a copy of the current color, lightened by the specified number of shades.

public lighten(int $shade) : static
Parameters
$shade : int
Return values
static

        
On this page

Search results