terminal.ts

 1import { useTheme } from "../theme"
 2
 3export default function terminal() {
 4    const theme = useTheme()
 5
 6    /**
 7     * Colors are controlled per-cell in the terminal grid.
 8     * Cells can be set to any of these more 'theme-capable' colors
 9     * or can be set directly with RGB values.
10     * Here are the common interpretations of these names:
11     * https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
12     */
13    return {
14        black: theme.ramps.neutral(0).hex(),
15        red: theme.ramps.red(0.5).hex(),
16        green: theme.ramps.green(0.5).hex(),
17        yellow: theme.ramps.yellow(0.5).hex(),
18        blue: theme.ramps.blue(0.5).hex(),
19        magenta: theme.ramps.magenta(0.5).hex(),
20        cyan: theme.ramps.cyan(0.5).hex(),
21        white: theme.ramps.neutral(1).hex(),
22        bright_black: theme.ramps.neutral(0.4).hex(),
23        bright_red: theme.ramps.red(0.25).hex(),
24        bright_green: theme.ramps.green(0.25).hex(),
25        bright_yellow: theme.ramps.yellow(0.25).hex(),
26        bright_blue: theme.ramps.blue(0.25).hex(),
27        bright_magenta: theme.ramps.magenta(0.25).hex(),
28        bright_cyan: theme.ramps.cyan(0.25).hex(),
29        bright_white: theme.ramps.neutral(1).hex(),
30        /**
31         * Default color for characters
32         */
33        foreground: theme.ramps.neutral(1).hex(),
34        /**
35         * Default color for the rectangle background of a cell
36         */
37        background: theme.ramps.neutral(0).hex(),
38        modal_background: theme.ramps.neutral(0.1).hex(),
39        /**
40         * Default color for the cursor
41         */
42        cursor: theme.players[0].cursor,
43        dim_black: theme.ramps.neutral(1).hex(),
44        dim_red: theme.ramps.red(0.75).hex(),
45        dim_green: theme.ramps.green(0.75).hex(),
46        dim_yellow: theme.ramps.yellow(0.75).hex(),
47        dim_blue: theme.ramps.blue(0.75).hex(),
48        dim_magenta: theme.ramps.magenta(0.75).hex(),
49        dim_cyan: theme.ramps.cyan(0.75).hex(),
50        dim_white: theme.ramps.neutral(0.6).hex(),
51        bright_foreground: theme.ramps.neutral(1).hex(),
52        dim_foreground: theme.ramps.neutral(0).hex(),
53    }
54}