Skip to content

Commit e728b94

Browse files
committed
fix: panic when theme has 'none'
1 parent 49040c0 commit e728b94

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • packages/opencode/src/cli/cmd/tui/context

packages/opencode/src/cli/cmd/tui/context/theme.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ function resolveTheme(theme: ThemeJson, mode: "dark" | "light") {
130130
const defs = theme.defs ?? {}
131131
function resolveColor(c: ColorValue): RGBA {
132132
if (c instanceof RGBA) return c
133-
if (typeof c === "string") return c.startsWith("#") ? RGBA.fromHex(c) : resolveColor(defs[c])
133+
if (typeof c === "string") {
134+
if (c === "transparent" || c === "none") return RGBA.fromInts(0, 0, 0, 0)
135+
return c.startsWith("#") ? RGBA.fromHex(c) : resolveColor(defs[c])
136+
}
134137
return resolveColor(c[mode])
135138
}
136139
return Object.fromEntries(

0 commit comments

Comments
 (0)