Skip to content

The open source coding agent.

TypeScript

fix: panic when theme has 'none'

Aiden Clinee728b94bcaac
diff --git a/packages/opencode/src/cli/cmd/tui/context/theme.tsx b/packages/opencode/src/cli/cmd/tui/context/theme.tsx
index 4f3012412fa..a4a4d876e2b 100644
--- a/packages/opencode/src/cli/cmd/tui/context/theme.tsx
+++ b/packages/opencode/src/cli/cmd/tui/context/theme.tsx
@@ -130,7 +130,10 @@ function resolveTheme(theme: ThemeJson, mode: "dark" | "light") {
const defs = theme.defs ?? {}
function resolveColor(c: ColorValue): RGBA {
if (c instanceof RGBA) return c
- if (typeof c === "string") return c.startsWith("#") ? RGBA.fromHex(c) : resolveColor(defs[c])
+ if (typeof c === "string") {
+ if (c === "transparent" || c === "none") return RGBA.fromInts(0, 0, 0, 0)
+ return c.startsWith("#") ? RGBA.fromHex(c) : resolveColor(defs[c])
+ }
return resolveColor(c[mode])
}
return Object.fromEntries(