F
Filament2mo ago
Xavi

Register colors

I register new colors on Panel with this code:
public function boot(): void
{
FilamentColor::register([
'primary' => Color::hex('#4d8bff'),
'secondary' => Color::hex('#4E8AFF'),
'orange' => Color::hex('#4E8AFF'),
]);
}
public function boot(): void
{
FilamentColor::register([
'primary' => Color::hex('#4d8bff'),
'secondary' => Color::hex('#4E8AFF'),
'orange' => Color::hex('#4E8AFF'),
]);
}
but when i try to use with <x-filament::button color="orange">Test</x-filament::button>, it doesn't works. How can i do it? Thanks!
5 Replies
Miguel García
Miguel García2mo ago
It seems that you are using #4E8AFF expecting to see something orange but it is actually blue, your code is ok, just change #4E8AFF for something orange
Diogo Pinto
Diogo Pinto5w ago
When you generate a color from HEX, it generates some shades based on the Colors helper. Try to change your code to
color="orange-500"
color="orange-500"
Not sure it will work though, not on my laptop to test it out
Xavi
XaviOP5w ago
💯
Diogo Pinto
Diogo Pinto5w ago
It worked?
Xavi
XaviOP5w ago
yes, combined with Miguel, it works fine!
Want results from more Discord servers?
Add your server