Kirki_Color::sanitize_color PHP Method

sanitize_color() public static method

Determine if the current value is a hex or an rgba color and call the appropriate method.
Since: 0.8.5
public static sanitize_color ( string | array $color = '', string $mode = 'auto' ) : string
$color string | array The color.
$mode string The mode to be used.
return string
        public static function sanitize_color($color = '', $mode = 'auto')
        {
            if (is_string($color) && 'transparent' == trim($color)) {
                return 'transparent';
            }
            $obj = ariColor::newColor($color);
            if ('auto' == $mode) {
                $mode = $obj->mode;
            }
            return $obj->toCSS($mode);
        }