Skip to content

Function: toRgbaString() ​

ts
function toRgbaString(color): string;

Returns a CSS rgba(r, g, b, a) string from an RgbColor object.

Parameters ​

ParameterType
colorRgbColor

Returns ​

string

Example ​

ts
toRgbaString({ r: 255, g: 102, b: 0, a: 0.5 }) // => 'rgba(255, 102, 0, 0.5)'

Since ​

1.0.0

Released under the MIT License.