export const hexToRgba = (hex, opacity) => { const r = parseInt(hex.substring(1, 3), 16); const g = parseInt(hex.substring(3, 5), 16); const b = parseInt(hex.substring(5, 7), 16); return `rgba(${r}, ${g}, ${b}, ${opacity})`; }; export function enumValues(e: object) { return Object.keys(e).map(k => e[k as any]); }