vantabot/irccolors.ml

27 lines
645 B
OCaml
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 ^ ""