Methods

Converts a color (named, hex or rgb) into an RGBA string Supports namedcolor, #abc, #abcdef and rgb(0, 128, 255)

rgba(string $color, float $alpha) : string
Static

Parameters

$color

string

$alpha

float

Returns

stringReturns the original color if an RGBA match cannot be made

Converts a color into a non-alpha-transparent version.

unRgba(string $color) : string
Static

Supports named color, #abc, #abcdef and rgb(a)

Parameters

$color

string

Returns

string

 Properties

 

$colors : array

Matches the list provided in color_picker.js

 

$rgbRegex : string

Components captured to 1=r, 2=g, 3=b.

 

$rgbaRegex : string

Components captured to 1=r, 2=g, 3=b, 4=a.