Overview
Filament uses CSS variables to define its color palette. These CSS variables are mapped to Tailwind classes in the preset file that you load when installing Filament.Customizing the default colors
From a service provider’sboot() method, or middleware, you can call the FilamentColor::register() method, which you can use to customize which colors Filament uses for UI elements.
There are 6 default colors that are used throughout Filament that you are able to customize:
Color class contains every Tailwind CSS color to choose from.
You can also pass in a function to register() which will only get called when the app is getting rendered. This is useful if you are calling register() from a service provider, and want to access objects like the currently authenticated user, which are initialized later in middleware.
Using a non-Tailwind color
You can use custom colors that are not included in the Tailwind CSS color palette by passing an array of color shades from50 to 950 in RGB format:
Generating a custom color from a hex code
You can use theColor::hex() method to generate a custom color palette from a hex code:
Generating a custom color from an RGB value
You can use theColor::rgb() method to generate a custom color palette from an RGB value:
Registering extra colors
You can register extra colors that you can use throughout Filament:primary, danger, etc.