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);
    }