2022-03-03 02:34:19 +03:00
|
|
|
import { ITheme } from 'xterm';
|
|
|
|
|
|
|
|
export const makeTheme = (dark: boolean): ITheme => {
|
|
|
|
let fg, bg: string;
|
|
|
|
if (dark) {
|
|
|
|
fg = 'white';
|
|
|
|
bg = 'rgb(26,26,26)';
|
|
|
|
} else {
|
|
|
|
fg = 'black';
|
|
|
|
bg = 'white';
|
|
|
|
}
|
|
|
|
// TODO indigo colors.
|
|
|
|
// we can't pluck these from ThemeContext because they have transparency.
|
|
|
|
// technically xterm supports transparency, but it degrades performance.
|
|
|
|
return {
|
|
|
|
foreground: fg,
|
|
|
|
background: bg,
|
|
|
|
brightBlack: '#7f7f7f', // NOTE slogs
|
2022-04-13 18:47:30 +03:00
|
|
|
cursor: fg,
|
2022-05-15 20:01:02 +03:00
|
|
|
cursorAccent: bg,
|
2022-04-13 18:47:30 +03:00
|
|
|
selection: fg
|
2022-03-03 02:34:19 +03:00
|
|
|
};
|
|
|
|
};
|