We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a568f4 commit b3e15c2Copy full SHA for b3e15c2
js/src/utilities/rgb-to-hex.js
@@ -10,6 +10,9 @@ const rgbToHex = (color) => {
10
if (typeof color === 'undefined') {
11
throw new Error('Hex color is not defined')
12
}
13
+ if (color === 'transparent') {
14
+ return '#00000000'
15
+ }
16
const rgb = color.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i)
17
if (!rgb) {
18
throw new Error(`${color} is not a valid rgb color`)
0 commit comments