MOON
Server: Apache
System: Linux server1.studioinfinity.com.br 2.6.32-954.3.5.lve1.4.90.el6.x86_64 #1 SMP Tue Feb 21 12:26:30 UTC 2023 x86_64
User: artinside (517)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/artinside/sites.artinside.com.br/mainpro/vendor/aplus/cli/src/Styles/BackgroundColor.php
<?php declare(strict_types=1);
/*
 * This file is part of Aplus Framework CLI Library.
 *
 * (c) Natan Felles <natanfelles@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Framework\CLI\Styles;

/**
 * Enum BackgroundColor.
 *
 * @package cli
 */
enum BackgroundColor : string
{
    case black = 'black';
    case red = 'red';
    case green = 'green';
    case yellow = 'yellow';
    case blue = 'blue';
    case magenta = 'magenta';
    case cyan = 'cyan';
    case white = 'white';
    case brightBlack = 'bright_black';
    case brightRed = 'bright_red';
    case brightGreen = 'bright_green';
    case brightYellow = 'bright_yellow';
    case brightBlue = 'bright_blue';
    case brightMagenta = 'bright_magenta';
    case brightCyan = 'bright_cyan';
    case brightWhite = 'bright_white';

    public function getCode() : string
    {
        return match ($this->value) {
            'black' => "\033[40m",
            'red' => "\033[41m",
            'green' => "\033[42m",
            'yellow' => "\033[43m",
            'blue' => "\033[44m",
            'magenta' => "\033[45m",
            'cyan' => "\033[46m",
            'white' => "\033[47m",
            'bright_black' => "\033[100m",
            'bright_red' => "\033[101m",
            'bright_green' => "\033[102m",
            'bright_yellow' => "\033[103m",
            'bright_blue' => "\033[104m",
            'bright_magenta' => "\033[105m",
            'bright_cyan' => "\033[106m",
            'bright_white' => "\033[107m",
        };
    }
}