public function cleanHex(string $hex): string
    {
        $hex = ltrim($hex, '#');

        if (!isset($hex[5])) {
            $hex = preg_replace('/(.)/u', '$1$1', $hex);
            $hex = $this->c::mbStrPad($hex, 6, '0');
        }
        return $hex;
    }
public function cleanHex(string $hex): string
    {
        $hex = ltrim($hex, '#');

        if (!isset($hex[5])) {
            $hex = preg_replace('/(.)/u', '$1$1', $hex);
            $hex = $this->c::mbStrPad($hex, 6, '0');
        }
        return $hex;
    }
public function cleanHex ( string $ hex ) : string { $ hex = ltrim ( $ hex , '#' ) ; if ( ! isset ( $ hex [ 5 ] ) ) { $ hex = preg_replace ( '/(.)/u' , '$1$1' , $ hex ) ; $ hex = $ this -> c :: mbStrPad ( $ hex , 6 , '0' ) ; } return $ hex ; }
Cleans a hex color.

@since 161010 Color utilities.

@param string $hex Hex color.

@return string Clean hex color.
Cleans a hex color .