What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-11 20:00:13
hex to rgba in js
hexToRGB(hex: string, alpha: string) { const r = parseInt(hex.slice(1, 3), 16); const g = parseInt(hex.slice(3, 5), 16); const b = parseInt(hex.slice(5, 7), 16); if (alpha) { return `rgba(${r}, ${g}, ${b}, ${alpha})`; } else { return `... Add solution