{"record":{"id":"9ed54f729b12f5ca","repo":"filamentphp/filament","slug":"at-least-one-lightbackground-candidate-must-be","errorCode":null,"errorMessage":"At least one `lightBackground()` candidate must be configured before calling `get()`.","messagePattern":"At least one `lightBackground\\(\\)` candidate must be configured before calling `get\\(\\)`\\.","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"packages/support/src/View/Components/ColorMaps/ButtonComponentColorMap.php","lineNumber":88,"sourceCode":"    /**\n     * Add a candidate `(bg, hover, alternateHover?)` triplet for dark mode. Each call appends\n     * a candidate; the resolver evaluates them in the order added using the same two-pass\n     * algorithm as `lightBackground()`.\n     */\n    public function darkBackground(int $bg, int $hover, ?int $alternateHover = null): static\n    {\n        $this->darkBackgrounds[] = ['bg' => $bg, 'hover' => $hover, 'alternateHover' => $alternateHover];\n\n        return $this;\n    }\n\n    /**\n     * @return array<string, int>\n     */\n    public function get(): array\n    {\n        if (empty($this->lightBackgrounds)) {\n            throw new LogicException('At least one `lightBackground()` candidate must be configured before calling `get()`.');\n        }\n\n        if (empty($this->darkBackgrounds)) {\n            throw new LogicException('At least one `darkBackground()` candidate must be configured before calling `get()`.');\n        }\n\n        $textForBg = $this->resolveTextForEachBackground();\n\n        $textLightness = $this->probeTextLightness($textForBg);\n\n        [$bg, $hoverBg] = $this->pickBackgroundShades($textLightness, $this->lightBackgrounds);\n        [$darkBg, $darkHoverBg] = $this->pickBackgroundShades($textLightness, $this->darkBackgrounds);\n\n        return [\n            'bg' => $bg,\n            'hover:bg' => $hoverBg,\n            'dark:bg' => $darkBg,\n            'dark:hover:bg' => $darkHoverBg,","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/filamentphp/filament/blob/53483fa9340e4ec637985fe454ebb58afb92ea24/packages/support/src/View/Components/ColorMaps/ButtonComponentColorMap.php#L70-L106","documentation":"Error \"At least one `lightBackground()` candidate must be configured before calling `get()`.\" thrown in filamentphp/filament.","triggerScenarios":"Thrown at packages/support/src/View/Components/ColorMaps/ButtonComponentColorMap.php:88 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"}