mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-09 23:15:36 +00:00
7 lines
193 B
TypeScript
7 lines
193 B
TypeScript
import hexRgb from 'hex-rgb';
|
|
|
|
export const rgba = (hex: string, alpha: number) => {
|
|
const rgb = hexRgb(hex, { format: 'array' }).slice(0, -1).join(',');
|
|
return `rgba(${rgb},${alpha})`;
|
|
};
|