Extend ANSI module to support more colors and also background colors.

This commit is contained in:
Dominik Pantůček 2023-03-27 22:00:39 +02:00
parent 3e9b421f60
commit 1a35c65f1d
3 changed files with 68 additions and 5 deletions

View file

@ -40,7 +40,8 @@
(chicken base)
configuration
member-record
month)
month
ansi)
;; Returns a list of months where each month is a list containing:
;; * month (from month module)
@ -77,9 +78,15 @@
(define (member-calendar-entry->string e)
(if e
(if (member 'existing (cadr e))
"EEE"
" ")
" "))
(if (member 'suspended (cadr e))
(ansi-string #:bgdarkgrey " ") ; Suspended
(if (member 'destroyed (cadr e))
(ansi-string #:bgblack "~~~") ; Destroyed
(if (member 'student (cadr e))
(ansi-string #:bgyellow " ") ; Student
(ansi-string #:bggreen " ")))) ; Normal
" ") ; Nonexistent - should not happen
" ")) ; Nonexistent
;; Converts the calendar into a table where rows represent years and
;; contain the year in the first cell and 12 cells for months after