terminal.ts

 1import { Elevation } from "../themes/common/colorScheme";
 2
 3export default function terminal(elevation: Elevation, cursor_color: string) {
 4  /**
 5   * Colors are controlled per-cell in the terminal grid.
 6   * Cells can be set to any of these more 'theme-capable' colors
 7   * or can be set directly with RGB values.
 8   * Here are the common interpretations of these names:
 9   * https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
10   */
11  return {
12    black: elevation.ramps.neutral(0).hex(),
13    red: elevation.ramps.red(0.5).hex(),
14    green: elevation.ramps.green(0.5).hex(),
15    yellow: elevation.ramps.yellow(0.5).hex(),
16    blue: elevation.ramps.blue(0.5).hex(),
17    magenta: elevation.ramps.magenta(0.5).hex(),
18    cyan: elevation.ramps.cyan(0.5).hex(),
19    white: elevation.ramps.neutral(1).hex(),
20    brightBlack: elevation.ramps.neutral(0.4).hex(),
21    brightRed: elevation.ramps.red(0.25).hex(),
22    brightGreen: elevation.ramps.green(0.25).hex(),
23    brightYellow: elevation.ramps.yellow(0.25).hex(),
24    brightBlue: elevation.ramps.blue(0.25).hex(),
25    brightMagenta: elevation.ramps.magenta(0.25).hex(),
26    brightCyan: elevation.ramps.cyan(0.25).hex(),
27    brightWhite: elevation.ramps.neutral(1).hex(),
28    /**
29     * Default color for characters
30     */
31    foreground: elevation.ramps.neutral(1).hex(),
32    /**
33     * Default color for the rectangle background of a cell
34     */
35    background: elevation.ramps.neutral(0).hex(),
36    modalBackground: elevation.ramps.neutral(0.1).hex(),
37    /**
38     * Default color for the cursor
39     */
40    cursor: cursor_color,
41    dimBlack: elevation.ramps.neutral(1).hex(),
42    dimRed: elevation.ramps.red(0.75).hex(),
43    dimGreen: elevation.ramps.green(0.75).hex(),
44    dimYellow: elevation.ramps.yellow(0.75).hex(),
45    dimBlue: elevation.ramps.blue(0.75).hex(),
46    dimMagenta: elevation.ramps.magenta(0.75).hex(),
47    dimCyan: elevation.ramps.cyan(0.75).hex(),
48    dimWhite: elevation.ramps.neutral(0.6).hex(),
49    brightForeground: elevation.ramps.neutral(1).hex(),
50    dimForeground: elevation.ramps.neutral(0).hex(),
51  };
52}