{"record":{"id":"2e67e1f1a4b04239","repo":"filamentphp/filament","slug":"a-lightsurface-must-be-configured-before-calli","errorCode":null,"errorMessage":"A `lightSurface()` must be configured before calling `get()`.","messagePattern":"A `lightSurface\\(\\)` must be configured before calling `get\\(\\)`\\.","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"packages/support/src/View/Components/ColorMaps/IconButtonComponentColorMap.php","lineNumber":77,"sourceCode":"        $this->darkSurface = $color;\n\n        return $this;\n    }\n\n    public function darkMaxShade(int $shade): static\n    {\n        $this->darkMaxShade = $shade;\n\n        return $this;\n    }\n\n    /**\n     * @return array<string, int>\n     */\n    public function get(): array\n    {\n        if ($this->lightSurface === null) {\n            throw new LogicException('A `lightSurface()` must be configured before calling `get()`.');\n        }\n\n        if ($this->darkSurface === null) {\n            throw new LogicException('A `darkSurface()` must be configured before calling `get()`.');\n        }\n\n        $lightShade = Color::findShade(\n            palette: $this->palette,\n            surface: $this->lightSurface,\n            minRatio: $this->minContrastRatio,\n        );\n\n        if ($lightShade === null) {\n            $text = 900;\n            $hoverText = 800;\n        } elseif ($lightShade > 500) {\n            // Shades above 500 are likely to be quite dark, so instead of lightening the icon\n            // when it is hovered, we darken it.","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/filamentphp/filament/blob/53483fa9340e4ec637985fe454ebb58afb92ea24/packages/support/src/View/Components/ColorMaps/IconButtonComponentColorMap.php#L59-L95","documentation":"Error \"A `lightSurface()` must be configured before calling `get()`.\" thrown in filamentphp/filament.","triggerScenarios":"Thrown at packages/support/src/View/Components/ColorMaps/IconButtonComponentColorMap.php:77 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"53483fa9340e4ec637985fe454ebb58afb92ea24","analyzedAt":"2026-08-17T02:06:23.049Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}