|
| 1 | +<?php |
| 2 | + |
| 3 | +/* |
| 4 | +<COPYRIGHT> |
| 5 | +
|
| 6 | + Copyright © 2016-2025, Canyon GBS LLC. All rights reserved. |
| 7 | +
|
| 8 | + Canyon GBS Common is licensed under the Elastic License 2.0. For more details, |
| 9 | + see https://github.com/canyongbs/common/blob/main/LICENSE. |
| 10 | +
|
| 11 | + Notice: |
| 12 | +
|
| 13 | + - You may not provide the software to third parties as a hosted or managed |
| 14 | + service, where the service provides users with access to any substantial set of |
| 15 | + the features or functionality of the software. |
| 16 | + - You may not move, change, disable, or circumvent the license key functionality |
| 17 | + in the software, and you may not remove or obscure any functionality in the |
| 18 | + software that is protected by the license key. |
| 19 | + - You may not alter, remove, or obscure any licensing, copyright, or other notices |
| 20 | + of the licensor in the software. Any use of the licensor’s trademarks is subject |
| 21 | + to applicable law. |
| 22 | + - Canyon GBS LLC respects the intellectual property rights of others and expects the |
| 23 | + same in return. Canyon GBS™ and Canyon GBS Common are registered trademarks of |
| 24 | + Canyon GBS LLC, and we are committed to enforcing and protecting our trademarks |
| 25 | + vigorously. |
| 26 | + - The software solution, including services, infrastructure, and code, is offered as a |
| 27 | + Software as a Service (SaaS) by Canyon GBS LLC. |
| 28 | + - Use of this software implies agreement to the license terms and conditions as stated |
| 29 | + in the Elastic License 2.0. |
| 30 | +
|
| 31 | + For more information or inquiries please visit our website at |
| 32 | + https://www.canyongbs.com or contact us via email at [email protected]. |
| 33 | +
|
| 34 | +</COPYRIGHT> |
| 35 | +*/ |
| 36 | + |
| 37 | +namespace CanyonGBS\Common\Enums; |
| 38 | + |
| 39 | +use Filament\Support\Contracts\HasLabel; |
| 40 | +use Filament\Support\Facades\FilamentColor; |
| 41 | + |
| 42 | +enum Color: string implements HasLabel |
| 43 | +{ |
| 44 | + case Gray = 'gray'; |
| 45 | + |
| 46 | + case Red = 'red'; |
| 47 | + |
| 48 | + case Orange = 'orange'; |
| 49 | + |
| 50 | + case Amber = 'amber'; |
| 51 | + |
| 52 | + case Yellow = 'yellow'; |
| 53 | + |
| 54 | + case Lime = 'lime'; |
| 55 | + |
| 56 | + case Green = 'green'; |
| 57 | + |
| 58 | + case Emerald = 'emerald'; |
| 59 | + |
| 60 | + case Teal = 'teal'; |
| 61 | + |
| 62 | + case Cyan = 'cyan'; |
| 63 | + |
| 64 | + case Sky = 'sky'; |
| 65 | + |
| 66 | + case Blue = 'blue'; |
| 67 | + |
| 68 | + case Indigo = 'indigo'; |
| 69 | + |
| 70 | + case Violet = 'violet'; |
| 71 | + |
| 72 | + case Purple = 'purple'; |
| 73 | + |
| 74 | + case Fuchsia = 'fuchsia'; |
| 75 | + |
| 76 | + case Pink = 'pink'; |
| 77 | + |
| 78 | + case Rose = 'rose'; |
| 79 | + |
| 80 | + public function getLabel(): string |
| 81 | + { |
| 82 | + return $this->name; |
| 83 | + } |
| 84 | + |
| 85 | + public function getRgb(): string |
| 86 | + { |
| 87 | + $color = FilamentColor::getColors()[$this->value][500]; |
| 88 | + |
| 89 | + return "rgb({$color})"; |
| 90 | + } |
| 91 | +} |
0 commit comments