aboutsummaryrefslogtreecommitdiffstats
path: root/src/ansi/colors.rs
diff options
context:
space:
mode:
authorJonas Maier <jonas@x77.dev>2026-05-23 14:48:51 +0200
committerJonas Maier <jonas@x77.dev>2026-05-23 14:48:51 +0200
commite4c0fc7beab2a6dd53210263a857f2b3ec29b604 (patch)
tree47137f101e5caaa93273cb03eeea92e0616537ca /src/ansi/colors.rs
parentba9414b17a107bdb30fe462aa2d42f6e91b3ad74 (diff)
downloadpish-e4c0fc7beab2a6dd53210263a857f2b3ec29b604.tar.gz
customizable syntax highlighting
Diffstat (limited to 'src/ansi/colors.rs')
-rw-r--r--src/ansi/colors.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/ansi/colors.rs b/src/ansi/colors.rs
new file mode 100644
index 0000000..d14dc81
--- /dev/null
+++ b/src/ansi/colors.rs
@@ -0,0 +1,28 @@
+macro_rules! color {
+ ($($name: ident = $num:expr ;)*) => {
+ $(
+ #[allow(unused)]
+ pub const $name: &str = concat!("\x1b[", stringify!($num), "m");
+ )*
+ };
+}
+
+color! {
+ RESET = 0;
+ BLACK_FG = 30;
+ BLACK_BG = 40;
+ RED_FG = 31;
+ RED_BG = 41;
+ GREEN_FG = 32;
+ GREEN_BG = 42;
+ YELLOW_FG = 33;
+ YELLOW_BG = 43;
+ BLUE_FG = 34;
+ BLUE_BG = 44;
+ MAGENTA_FG = 35;
+ MAGENTA_BG = 45;
+ CYAN_FG = 36;
+ CYAN_BG = 46;
+ WHITE_FG = 37;
+ WHITE_BG = 47;
+}