MCPcopy Create free account
hub / github.com/anomalyco/opencode / getTerminalColors

Function getTerminalColors

packages/app/src/components/terminal.tsx:232–251  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

230 }
231
232 const getTerminalColors = (): TerminalColors => {
233 const mode = theme.mode() === "dark" ? "dark" : "light"
234 const fallback = DEFAULT_TERMINAL_COLORS[mode]
235 const currentTheme = theme.themes()[theme.themeId()]
236 if (!currentTheme) return fallback
237 const variant = mode === "dark" ? currentTheme.dark : currentTheme.light
238 if (!variant?.seeds && !variant?.palette) return fallback
239 const resolved = resolveThemeVariant(variant, mode === "dark")
240 const text = resolved["text-stronger"] ?? fallback.foreground
241 const background = resolved["background-stronger"] ?? fallback.background
242 const alpha = mode === "dark" ? 0.25 : 0.2
243 const base = text.startsWith("#") ? (text as HexColor) : (fallback.foreground as HexColor)
244 const selectionBackground = withAlpha(base, alpha)
245 return {
246 background,
247 foreground: text,
248 cursor: text,
249 selectionBackground,
250 }
251 }
252
253 const terminalColors = createMemo(getTerminalColors)
254

Callers

nothing calls this directly

Calls 2

resolveThemeVariantFunction · 0.90
withAlphaFunction · 0.90

Tested by

no test coverage detected