Skip to content

Function: alpha()

ts
function alpha(hex, value): string;

Returns a CSS rgba() string for the given hex color with a custom alpha.

Parameters

ParameterType
hexstring
valuenumber

Returns

string

Example

ts
alpha('#ff6600', 0.5) // => 'rgba(255, 102, 0, 0.5)'

Since

1.0.0

Released under the MIT License.