mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-22 16:48:23 +01:00
19 lines
601 B
TypeScript
19 lines
601 B
TypeScript
// Copyright 2024, Command Line Inc.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
export const DefaultTermTheme = "default-dark";
|
|
|
|
// returns (theme, bgcolor)
|
|
function computeTheme(fullConfig: FullConfigType, themeName: string): [TermThemeType, string] {
|
|
let theme: TermThemeType = fullConfig?.termthemes?.[themeName];
|
|
if (theme == null) {
|
|
theme = fullConfig?.termthemes?.[DefaultTermTheme] || ({} as any);
|
|
}
|
|
const themeCopy = { ...theme };
|
|
let bgcolor = themeCopy.background;
|
|
themeCopy.background = "#00000000";
|
|
return [themeCopy, bgcolor];
|
|
}
|
|
|
|
export { computeTheme };
|