support for "transparent" color keyword
This commit is contained in:
parent
6e11924c27
commit
332d31dc02
5 changed files with 78 additions and 44 deletions
|
@ -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') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue