git.annexia.org
/
todo.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Initial commit.
[todo.git]
/
todo_tag_utils.ml
1
(* Utility functions related to tags. *)
2
3
open Printf
4
5
let string_of_tag name colour =
6
let bg, fg =
7
match colour with
8
(* white fg *)
9
| "black" -> 40, 37
10
| "blue" -> 44, 37
11
| "green" -> 42, 37
12
| "red" -> 41, 37
13
| "purple" -> 45, 37
14
15
(* black fg *)
16
| "cyan" -> 46, 30
17
| "yellow" -> 43, 30
18
| _ -> assert false in
19
20
sprintf "\x1b[%d;%dm\x1b[%d;%dm %s \x1b[0m" 1 fg 1 bg name