F
Filament3mo 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ía3mo 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 Pinto3mo 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
XaviOP3mo ago
💯
Diogo Pinto
Diogo Pinto3mo ago
It worked?
Xavi
XaviOP3mo ago
yes, combined with Miguel, it works fine!

Did you find this page helpful?