()
| 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 |
nothing calls this directly
no test coverage detected