filamentphp/filament · error · LogicException

A `lightSurface()` must be configured before calling `get()`

Error message

A `lightSurface()` must be configured before calling `get()`.

What it means

Error "A `lightSurface()` must be configured before calling `get()`." thrown in filamentphp/filament.

Source

Thrown at packages/support/src/View/Components/ColorMaps/IconButtonComponentColorMap.php:77

        $this->darkSurface = $color;

        return $this;
    }

    public function darkMaxShade(int $shade): static
    {
        $this->darkMaxShade = $shade;

        return $this;
    }

    /**
     * @return array<string, int>
     */
    public function get(): array
    {
        if ($this->lightSurface === null) {
            throw new LogicException('A `lightSurface()` must be configured before calling `get()`.');
        }

        if ($this->darkSurface === null) {
            throw new LogicException('A `darkSurface()` must be configured before calling `get()`.');
        }

        $lightShade = Color::findShade(
            palette: $this->palette,
            surface: $this->lightSurface,
            minRatio: $this->minContrastRatio,
        );

        if ($lightShade === null) {
            $text = 900;
            $hoverText = 800;
        } elseif ($lightShade > 500) {
            // Shades above 500 are likely to be quite dark, so instead of lightening the icon
            // when it is hovered, we darken it.

View on GitHub (pinned to 53483fa934)

When it happens

Trigger: Thrown at packages/support/src/View/Components/ColorMaps/IconButtonComponentColorMap.php:77 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of filamentphp/filament@53483fa934 (2026-08-17). Data as JSON: /api/errors/2e67e1f1a4b04239. Report an issue: GitHub.