{"record":{"id":"32f63f38af78a99b","repo":"filamentphp/filament","slug":"at-least-one-darkbackground-candidate-must-be","errorCode":null,"errorMessage":"At least one `darkBackground()` candidate must be configured before calling `get()`.","messagePattern":"At least one `darkBackground\\(\\)` 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":92,"sourceCode":"     */\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,\n            'text' => $textForBg[$bg] ?? 0,\n            'hover:text' => $textForBg[$hoverBg] ?? 0,\n            'dark:text' => $textForBg[$darkBg] ?? 0,\n            'dark:hover:text' => $textForBg[$darkHoverBg] ?? 0,","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/filamentphp/filament/blob/53483fa9340e4ec637985fe454ebb58afb92ea24/packages/support/src/View/Components/ColorMaps/ButtonComponentColorMap.php#L74-L110","documentation":"Error \"At least one `darkBackground()` candidate must be configured before calling `get()`.\" thrown in filamentphp/filament.","triggerScenarios":"Thrown at packages/support/src/View/Components/ColorMaps/ButtonComponentColorMap.php:92 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"}