From 039f5f7282e83d6ff1100e994b05c505f537fde8 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sun, 26 Sep 2021 22:34:23 +0530 Subject: gnbug: Organize color codes. Create functions for all 3 bit colors (except black and white), both foreground and background. * gnbug (yellow, red-background, green-background, yellow-background, blue-background, magenta-background, cyan-background): New functions. (magenta): Move function below the blue function. --- gnbug | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'gnbug') diff --git a/gnbug b/gnbug index b722b9e..becc39f 100755 --- a/gnbug +++ b/gnbug @@ -218,6 +218,10 @@ there is no such commit." port)) "git" "log" "--format=format:%H" "--since" since)) +;;; +;;; 3 bit colors using ANSI escape codes +;;; + (define (color code str) "Return STR within ANSI escape CODE, thus rendering it in color in a terminal." @@ -225,10 +229,18 @@ terminal." (define red (cut color 31 <>)) (define green (cut color 32 <>)) -(define magenta (cut color 35 <>)) +(define yellow (cut color 33 <>)) (define blue (cut color 34 <>)) +(define magenta (cut color 35 <>)) (define cyan (cut color 36 <>)) +(define red-background (cut color 41 <>)) +(define green-background (cut color 42 <>)) +(define yellow-background (cut color 43 <>)) +(define blue-background (cut color 44 <>)) +(define magenta-background (cut color 45 <>)) +(define cyan-background (cut color 46 <>)) + (define (invalid-option name arg loads) (error "Invalid option" name)) -- cgit v1.2.3