1
5
mirror of https://github.com/vinc/moros.git synced 2024-06-15 05:36:38 +00:00
moros/dsk/tmp/lisp/colors.lsp
Vincent Ollivier 4d50eae287
Refactor lisp functions (#478)
* Refactor function names

* Rename list_of_xs into xs

* Rename bytes to binary

* Fix failing tests

* Update changelog

* Remove legacy functions
2023-04-22 15:46:05 +02:00

24 lines
441 B
Common Lisp

(load "/lib/lisp/core.lsp")
(var esc (bin->str '(27)))
(def (ansi-color x y)
(str esc "[" x ";" y "m"))
(def (fg c)
(ansi-color c 40))
(def (bg c)
(ansi-color 30 c))
(def (color f c)
(str " " (f c) (if (< c 100) " " "") c (ansi-color 0 0)))
(def (colors fs i j)
(join-str (map (fun (c) (color fs c)) (range i j)) ""))
(print (colors fg 30 38))
(print (colors fg 90 98))
(print (colors bg 40 48))
(print (colors bg 100 108))