Branding colors
FilamentChromePlugin::make() ->primary('#F1511B') ->accent('#286291') ->darkPrimary('#C9A57B') // optional ->darkAccent('#8FCBD6') // optional ->darkGray('#18181B'); // optionalLight colors
Section titled “Light colors”primary(?string $hex)— wired through Filament’s color path: the plugin builds a full primary scale and registers it with$panel->colors(['primary' => …]). Without it, the active theme’stokens()['primary']is used (when the theme defines one).accent(?string $hex)— exposed as the--fi-chrome-accentCSS variable that themes use for highlights such as the treeline. Falls back to the theme’stokens()['accent'].
Plugin colors always win over theme tokens.
Dark overrides
Section titled “Dark overrides”darkPrimary(), darkAccent() and darkGray() inject .dark CSS overrides only when
set. When they are omitted, Filament’s default dark logic applies — the plugin does not
derive dark shades for you.
When set, each override generates a full 50–950 scale whose 500 shade is the exact input
hex, emitted inside a .dark { … } block after Filament’s own color variables (at the
STYLES_AFTER render hook):
| Method | Variables |
|---|---|
darkPrimary() |
--primary-*, --color-primary-* |
darkAccent() |
--accent-*, --fi-chrome-accent |
darkGray() |
--gray-*, --color-gray-* |
Hex input
Section titled “Hex input”Colors accept 3- or 6-digit hex, with or without # ('#F1511B', 'f1511b', '#fa0').
null, empty strings and malformed values are treated as “not set”.
With the theme switcher
Section titled “With the theme switcher”When the theme switcher is enabled, users can pick their own light / dark primary and accent. The effective color is:
- the user’s choice, then
- the plugin’s
->primary()/->accent()/->darkPrimary()/->darkAccent(), then - the active theme’s tokens.
Because the user’s choice is only known once the session starts, the light primary is
re-emitted as :root --primary-* variables at render time.