(
fullConfig: FullConfigType,
themeName: string,
termTransparency: number
)
| 31 | |
| 32 | // returns (theme, bgcolor, transparency (0 - 1.0)) |
| 33 | export 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 | |
| 56 | export const MIME_TO_EXT: Record<string, string> = { |
| 57 | "image/png": "png", |
no test coverage detected