ConsoleKit\Colors::extractColorAndOptions PHP Method

extractColorAndOptions() private static method

Extracts the options and the color from a color code
private static extractColorAndOptions ( integer $colorCode ) : array
$colorCode integer
return array
    private static function extractColorAndOptions($colorCode)
    {
        $options = array();
        foreach (self::$options as $name => $bit) {
            if (($colorCode & $bit) === $bit) {
                $options[] = self::$codes[$bit];
                $colorCode = $colorCode & ~$bit;
            }
        }
        if (!isset(self::$codes[$colorCode])) {
            throw new ConsoleException("Cannot parse color code");
        }
        return array(self::$codes[$colorCode], $options);
    }