terminal.ts

 1import { ColorScheme } from "../theme/color_scheme"
 2
 3export default function terminal(theme: ColorScheme) {
 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: theme.ramps.neutral(0).hex(),
13        red: theme.ramps.red(0.5).hex(),
14        green: theme.ramps.green(0.5).hex(),
15        yellow: theme.ramps.yellow(0.5).hex(),
16        blue: theme.ramps.blue(0.5).hex(),
17        magenta: theme.ramps.magenta(0.5).hex(),
18        cyan: theme.ramps.cyan(0.5).hex(),
19        white: theme.ramps.neutral(1).hex(),
20        bright_black: theme.ramps.neutral(0.4).hex(),
21        bright_red: theme.ramps.red(0.25).hex(),
22        bright_green: theme.ramps.green(0.25).hex(),
23        bright_yellow: theme.ramps.yellow(0.25).hex(),
24        bright_blue: theme.ramps.blue(0.25).hex(),
25        bright_magenta: theme.ramps.magenta(0.25).hex(),
26        bright_cyan: theme.ramps.cyan(0.25).hex(),
27        bright_white: theme.ramps.neutral(1).hex(),
28        /**
29         * Default color for characters
30         */
31        foreground: theme.ramps.neutral(1).hex(),
32        /**
33         * Default color for the rectangle background of a cell
34         */
35        background: theme.ramps.neutral(0).hex(),
36        modal_background: theme.ramps.neutral(0.1).hex(),
37        /**
38         * Default color for the cursor
39         */
40        cursor: theme.players[0].cursor,
41        dim_black: theme.ramps.neutral(1).hex(),
42        dim_red: theme.ramps.red(0.75).hex(),
43        dim_green: theme.ramps.green(0.75).hex(),
44        dim_yellow: theme.ramps.yellow(0.75).hex(),
45        dim_blue: theme.ramps.blue(0.75).hex(),
46        dim_magenta: theme.ramps.magenta(0.75).hex(),
47        dim_cyan: theme.ramps.cyan(0.75).hex(),
48        dim_white: theme.ramps.neutral(0.6).hex(),
49        bright_foreground: theme.ramps.neutral(1).hex(),
50        dim_foreground: theme.ramps.neutral(0).hex(),
51    }
52}