{"record":{"id":"bbb9ed4d9090a52c","repo":"filamentphp/filament","slug":"a-darksurface-must-be-configured-before-callin","errorCode":null,"errorMessage":"A `darkSurface()` must be configured before calling `get()`.","messagePattern":"A `darkSurface\\(\\)` must be configured before calling `get\\(\\)`\\.","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"packages/support/src/View/Components/ColorMaps/IconButtonComponentColorMap.php","lineNumber":81,"sourceCode":"\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.\n            $text = $lightShade;\n            $hoverText = $lightShade + 100;\n        } else {\n            $text = $lightShade + 100;","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/filamentphp/filament/blob/53483fa9340e4ec637985fe454ebb58afb92ea24/packages/support/src/View/Components/ColorMaps/IconButtonComponentColorMap.php#L63-L99","documentation":"Error \"A `darkSurface()` must be configured before calling `get()`.\" thrown in filamentphp/filament.","triggerScenarios":"Thrown at packages/support/src/View/Components/ColorMaps/IconButtonComponentColorMap.php:81 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"}