Skip to content
EliteChart

hexToRgba

Documentation


Documentation / @elitechart/core / hexToRgba

code
function hexToRgba(hex, alpha): string;

Defined in: ui/floating-toolbar.ts:462

Compose rgba(r,g,b,a) from #rrggbb + alpha. Inverse of parseColor.

Parameters

hex

string

alpha

number

Returns

string

Example

code
import { hexToRgba } from '@elitechart/core';
hexToRgba('#26a69a', 0.5); // 'rgba(38, 166, 154, 0.500)'