File: colors.ml

package info (click to toggle)
lambda-term 3.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,108 kB
  • sloc: ml: 14,981; ansic: 522; makefile: 32
file content (26 lines) | stat: -rw-r--r-- 565 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
(*
 * colors.ml
 * ---------
 * Copyright : (c) 2011, Jeremie Dimino <jeremie@dimino.org>
 * Licence   : BSD3
 *
 * This file is a part of Lambda-Term.
 *)

open Lwt
open LTerm_style
open LTerm_text

let () =
  let rec loop i =
    if i = 16 then
      Lwt.return ()
    else
      LTerm.printls (eval [S(Printf.sprintf "color %d: " i);
                           B_fg(index i); S"foreground"; E_fg;
                           S" ";
                           B_bg(index i); S"background"; E_bg])
      >>= fun () ->
      loop (i + 1)
  in
  Lwt_main.run (loop 0)