ColorUtils
in package

Tags
since
1.1.0

Table of Contents

darkOrLight()  : string
Detect which color shoud we use with the base color - dark or light.
hexDarker()  : string
hexLighter()  : string
hexToRgb()  : array<string|int, int>
rgbToHex()  : string

Methods

darkOrLight()

Detect which color shoud we use with the base color - dark or light.

public static darkOrLight(string $baseColor[, string $dark = '#000000' ][, string $light = '#FFFFFF' ]) : string
Parameters
$baseColor : string
$dark : string = '#000000'

Optional. '000000' by default.

$light : string = '#FFFFFF'

Optional. 'FFFFFF' by default.

Tags
since
1.1.0
Return values
string

$dark or $light.

hexDarker()

public static hexDarker(string $color, int $factor) : string
Parameters
$color : string
$factor : int
Tags
since
1.1.0
Return values
string

hexLighter()

public static hexLighter(string $color, int $factor) : string
Parameters
$color : string
$factor : int
Tags
since
1.1.0
Return values
string

hexToRgb()

public static hexToRgb(string $hex) : array<string|int, int>
Parameters
$hex : string
Tags
since
1.1.0
Return values
array<string|int, int>

rgbToHex()

public static rgbToHex(array<string|int, int> $rgb) : string
Parameters
$rgb : array<string|int, int>
Tags
since
1.1.0
Return values
string

Search results