support for "transparent" color keyword

This commit is contained in:
Henry Jameson 2019-12-30 00:45:48 +02:00
parent 6e11924c27
commit 332d31dc02
5 changed files with 78 additions and 44 deletions

View file

@ -7,7 +7,8 @@ const rgb2hex = (r, g, b) => {
if (r === null || typeof r === 'undefined') {
return undefined
}
if (r[0] === '#') {
// TODO: clean up this mess
if (r[0] === '#' || r === 'transparent') {
return r
}
if (typeof r === 'object') {