diff options
| author | Aiden Cline <[email protected]> | 2025-11-16 01:43:23 -0600 |
|---|---|---|
| committer | Aiden Cline <[email protected]> | 2025-11-16 01:43:23 -0600 |
| commit | e728b94bcaac1f019b3a03f04465b3c00d3fdc3a (patch) | |
| tree | dc8b784506efcbb590d8b8758cbb3548764b88dd | |
| parent | 49040c01305711838fe8c2d45bad635e0aaa42e7 (diff) | |
| download | opencode-e728b94bcaac1f019b3a03f04465b3c00d3fdc3a.tar.gz opencode-e728b94bcaac1f019b3a03f04465b3c00d3fdc3a.zip | |
fix: panic when theme has 'none'
| -rw-r--r-- | packages/opencode/src/cli/cmd/tui/context/theme.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/context/theme.tsx b/packages/opencode/src/cli/cmd/tui/context/theme.tsx index 4f3012412..a4a4d876e 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( |
