25 lines
653 B
PHP
25 lines
653 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Modules\Helpdesk\Support;
|
|
|
|
final class Color
|
|
{
|
|
public static function css(?string $color): string
|
|
{
|
|
return match ($color) {
|
|
'red', 'rose' => '#e11d48',
|
|
'amber', 'yellow' => '#d97706',
|
|
'emerald', 'green' => '#059669',
|
|
'blue' => '#2563eb',
|
|
'sky', 'cyan' => '#0284c7',
|
|
'indigo' => '#4f46e5',
|
|
'violet', 'purple' => '#7c3aed',
|
|
'slate' => '#334155',
|
|
'zinc', null, '' => '#52525b',
|
|
default => str_starts_with((string) $color, '#') ? (string) $color : '#52525b',
|
|
};
|
|
}
|
|
}
|