Bitrix API

Color

Table of Contents

Methods

__construct()  : mixed
Color constructor.
createFromHex()  : Color
Creates the color from a string like #ffaabb or ffaabb.
getAlpha()  : float
getBlue()  : int
getGreen()  : int
getRed()  : int
setAlpha()  : Color
setBlue()  : Color
setGreen()  : Color
setRed()  : Color
toHex()  : string
Returns hex representation e.g. #aabbcc.
toRgba()  : string
Returns rgba representation, e.g. rgba(255, 0, 0, 0.5)

Methods

__construct()

Color constructor.

public __construct([int $red = 0 ][, int $green = 0 ][, int $blue = 0 ][, float $alpha = 1.0 ]) : mixed
Parameters
$red : int = 0
$green : int = 0
$blue : int = 0
$alpha : float = 1.0

createFromHex()

Creates the color from a string like #ffaabb or ffaabb.

public static createFromHex(string $color) : Color
Parameters
$color : string
Return values
Color

getAlpha()

public getAlpha() : float
Return values
float

getBlue()

public getBlue() : int
Return values
int

getGreen()

public getGreen() : int
Return values
int

getRed()

public getRed() : int
Return values
int

setAlpha()

public setAlpha(float $alpha) : Color
Parameters
$alpha : float
Return values
Color

setBlue()

public setBlue(int $blue) : Color
Parameters
$blue : int
Return values
Color

setGreen()

public setGreen(int $green) : Color
Parameters
$green : int
Return values
Color

setRed()

public setRed(int $red) : Color
Parameters
$red : int
Return values
Color

toHex()

Returns hex representation e.g. #aabbcc.

public toHex() : string
Return values
string

toRgba()

Returns rgba representation, e.g. rgba(255, 0, 0, 0.5)

public toRgba() : string
Return values
string

        
On this page

Search results