Explorar el Código

fix: panic when theme has 'none'

Aiden Cline hace 3 meses
padre
commit
e728b94bca
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      packages/opencode/src/cli/cmd/tui/context/theme.tsx

+ 4 - 1
packages/opencode/src/cli/cmd/tui/context/theme.tsx

@@ -130,7 +130,10 @@ function resolveTheme(theme: ThemeJson, mode: "dark" | "light") {
   const defs = theme.defs ?? {}
   const defs = theme.defs ?? {}
   function resolveColor(c: ColorValue): RGBA {
   function resolveColor(c: ColorValue): RGBA {
     if (c instanceof RGBA) return c
     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 resolveColor(c[mode])
   }
   }
   return Object.fromEntries(
   return Object.fromEntries(