fix(theme): filter out null values from theme palette (#4083)

Signed-off-by: Kamaal Farah <kamaal.f1@gmail.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
This commit is contained in:
Kamaal Farah
2025-11-08 23:27:07 +01:00
committed by GitHub
parent 47b4cc6d53
commit 431ffc94f5

View File

@@ -196,7 +196,7 @@ export const { use: useTheme, provider: ThemeProvider } = createSimpleContext({
function generateSystem(colors: TerminalColors, mode: "dark" | "light"): ThemeJson {
const bg = RGBA.fromHex(colors.defaultBackground ?? colors.palette[0]!)
const fg = RGBA.fromHex(colors.defaultForeground ?? colors.palette[7]!)
const palette = colors.palette.map((x) => RGBA.fromHex(x!))
const palette = colors.palette.filter((x) => x !== null).map((x) => RGBA.fromHex(x))
const isDark = mode == "dark"
// Generate gray scale based on terminal background