MCPcopy Create free account
hub / github.com/wavetermdev/waveterm / computeTheme

Function computeTheme

frontend/app/view/term/termutil.ts:33–54  ·  view source on GitHub ↗
(
    fullConfig: FullConfigType,
    themeName: string,
    termTransparency: number
)

Source from the content-addressed store, hash-verified

31
32// returns (theme, bgcolor, transparency (0 - 1.0))
33export function computeTheme(
34 fullConfig: FullConfigType,
35 themeName: string,
36 termTransparency: number
37): [TermThemeType, string] {
38 let theme: TermThemeType = fullConfig?.termthemes?.[themeName];
39 if (theme == null) {
40 theme = fullConfig?.termthemes?.[DefaultTermTheme] || ({} as any);
41 }
42 const themeCopy = { ...theme };
43 if (termTransparency != null && termTransparency > 0) {
44 if (themeCopy.background) {
45 themeCopy.background = applyTransparencyToColor(themeCopy.background, termTransparency);
46 }
47 if (themeCopy.selectionBackground) {
48 themeCopy.selectionBackground = applyTransparencyToColor(themeCopy.selectionBackground, termTransparency);
49 }
50 }
51 const bgcolor = themeCopy.background;
52 themeCopy.background = "#00000000";
53 return [themeCopy, bgcolor];
54}
55
56export const MIME_TO_EXT: Record<string, string> = {
57 "image/png": "png",

Callers 3

TermThemeUpdaterFunction · 0.90
TerminalViewFunction · 0.90
constructorMethod · 0.90

Calls 1

applyTransparencyToColorFunction · 0.85

Tested by

no test coverage detected