public static function getColors(array $config = [], bool $pretty = true): array
    {
        $result = [];

        $config = empty($config) ? Configure::read('Colors') : $config;

        if (!$pretty) {
            return $config;
        }

        if (!$config) {
            return $result;
        }

        foreach ($config as $k => $v) {
            $result[$k] = '<div><div style="width:20px;height:20px;margin:0;border:1px solid #eee;float:left;background:' . $k . ';"></div>&nbsp;&nbsp;' . $v . '</div><div style="clear:all"></div>';
        }

        return $result;
    }
public static function getColors(array $config = [], bool $pretty = true): array
    {
        $result = [];

        $config = empty($config) ? Configure::read('Colors') : $config;

        if (!$pretty) {
            return $config;
        }

        if (!$config) {
            return $result;
        }

        foreach ($config as $k => $v) {
            $result[$k] = '<div><div style="width:20px;height:20px;margin:0;border:1px solid #eee;float:left;background:' . $k . ';"></div>&nbsp;&nbsp;' . $v . '</div><div style="clear:all"></div>';
        }

        return $result;
    }
public static function getColors ( array $ config = [ ] , bool $ pretty = true ) : array { $ result = [ ] ; $ config = empty ( $ config ) ? Configure :: read ( 'Colors' ) : $ config ; if ( ! $ pretty ) { return $ config ; } if ( ! $ config ) { return $ result ; } foreach ( $ config as $ k => $ v ) { $ result [ $ k ] = '<div><div style="width:20px;height:20px;margin:0;border:1px solid #eee;float:left;background:' . $ k . ';"></div>&nbsp;&nbsp;' . $ v . '</div><div style="clear:all"></div>' ; } return $ result ; }
Get colors for Select2 dropdown

@param mixed[] $config containing colors array
@param bool $pretty to append color identifiers to values.

@return mixed[] $result containing colors list.
Get colors for Select2 dropdown