public static function get_colors($type = 'hex')
    {
        $cached = self::$colorsCached;
        if (isset($cached[$type])) return $cached[$type];

        $colors = Config::inst()->get('Identity', 'colors');
        if ($type == 'rgb') {
            $rgbColors = [];
            foreach ($colors as $name => $c) {
                $rgbColors[$name] = self::hex2rgb($c);
            }
            $colors = $rgbColors;
        }
        self::$colorsCached[$type] = $colors;
        return $colors;
    }
public static function get_colors($type = 'hex')
    {
        $cached = self::$colorsCached;
        if (isset($cached[$type])) return $cached[$type];

        $colors = Config::inst()->get('Identity', 'colors');
        if ($type == 'rgb') {
            $rgbColors = [];
            foreach ($colors as $name => $c) {
                $rgbColors[$name] = self::hex2rgb($c);
            }
            $colors = $rgbColors;
        }
        self::$colorsCached[$type] = $colors;
        return $colors;
    }
public static function get_colors ( $ type = 'hex' ) { $ cached = self :: $ colorsCached ; if ( isset ( $ cached [ $ type ] ) ) return $ cached [ $ type ] ; $ colors = Config :: inst ( ) -> get ( 'Identity' , 'colors' ) ; if ( $ type == 'rgb' ) { $ rgbColors = [ ] ; foreach ( $ colors as $ name => $ c ) { $ rgbColors [ $ name ] = self :: hex2rgb ( $ c ) ; } $ colors = $ rgbColors ; } self :: $ colorsCached [ $ type ] = $ colors ; return $ colors ; }
Identify colors in either hex or rgb
@param string $type
@return array
Identify colors in either hex or rgb