F
Filament10mo ago
vkDas

How to use hex color code in v3 after upgrade from v2 to v3

I have used tailwind css colors like bg-primary-500 in v2 and after upgrade to v3 I want to use hex color code like #fffff but when i am taking any hex code from documentation and giving a custom name like 'test' => Color::hex(#ff0000) it is not showing the output in UI but if I give 'primary' => Color::hex(#ff0000) it is showing in UI. How can I fix this? Thank you
2 Replies
LeandroFerreira
LeandroFerreira10mo ago
app/Providers/AppServiceProvider.php
use Filament\Support\Colors\Color;
use Filament\Support\Facades\FilamentColor;

public function boot(): void
{
FilamentColor::register([
'test' => Color::hex('#ff0000'),
]);
}
use Filament\Support\Colors\Color;
use Filament\Support\Facades\FilamentColor;

public function boot(): void
{
FilamentColor::register([
'test' => Color::hex('#ff0000'),
]);
}
wyChoong
wyChoong10mo ago
You need to use the color on your component with ->(‘test’)