Bladeren bron

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

Signed-off-by: Kamaal Farah <[email protected]>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <[email protected]>
Kamaal Farah 3 maanden geleden
bovenliggende
commit
431ffc94f5
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. 1 1
      packages/opencode/src/cli/cmd/tui/context/theme.tsx

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

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