import tinycolor from "tinycolor2" ; param color returns export function normaliseColor ( color ) { const parsedColor = tinycolor ( color ) ; if ( ! parsedColor . isValid ( ) ) return null ; const isTransparent = parsedColor . getAlpha ( ) < 1 ; return parsedColor . toString ( isTransparent ? "rgb" : "hex" ) . toLowerCase ( ) ; }