You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

26 lines
645 B

type color_t = White | Black | Blue | Green | LightRed | Brown | Purple | Orange | Yellow | LightGreen | Cyan | LightCyan | LightBlue | Pink | Grey | LightGrey
let color_code (c : color_t) : int =
match c with
| White -> 0
| Black -> 1
| Blue -> 2
| Green -> 3
| LightRed -> 4
| Brown -> 5
| Purple -> 6
| Orange -> 7
| Yellow -> 8
| LightGreen -> 9
| Cyan -> 10
| LightCyan -> 11
| LightBlue -> 12
| Pink -> 13
| Grey -> 14
| LightGrey -> 15
let color_text ~fg ~bg (t : string) =
"" ^ string_of_int (color_code fg) ^
"," ^ string_of_int (color_code bg) ^ t
let bold_text (t : string) = "" ^ t ^ ""