[go: up one dir, main page]

File: dvicolor.mli

package info (click to toggle)
advi 1.10.2-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 15,008 kB
  • sloc: ml: 12,279; sh: 1,032; ansic: 1,016; makefile: 705; perl: 55
file content (51 lines) | stat: -rw-r--r-- 2,750 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
(***********************************************************************)
(*                                                                     *)
(*                             Active-DVI                              *)
(*                                                                     *)
(*                   Projet Cristal, INRIA Rocquencourt                *)
(*                                                                     *)
(*  Copyright 2002 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the GNU Lesser General Public License.          *)
(*                                                                     *)
(*  Jun Furuse, Didier Rmy and Pierre Weis.                           *)
(*  Contributions by Roberto Di Cosmo, Didier Le Botlan,               *)
(*  Xavier Leroy, and Alan Schmitt.                                    *)
(*                                                                     *)
(*  Based on Mldvi by Alexandre Miquel.                                *)
(***********************************************************************)

(* $Id: dvicolor.mli,v 1.1 2007/01/18 14:14:36 rousse Exp $ *)

type color = GraphicsY11.color;;

val parse_color : string -> color;;
(** Parses a string and return a color.
    A valid input string can be:
    - a color defined by [dvips], such as ["YellowOrange"] or ["Melon"],
    - a color predefined in the [Graphics] module, such as ["yellow"],
    - a color know by the [Camlimage] library (including X colors),
    - a mere integer specification (as understood by the Caml
      [int_of_string] primitive.
    Raises [Failure "int_of_string"] if the given string is not understood.
*)

val parse_color_args : string list -> color;;
(** Parses a list of strings as a color.
    The list may be:
    - a singleton [s]: [s] is parsed using [parse_color].
    - an empty list maps to medium gray (cmyk (0, 0, 0, 1/2).
    - otherwise, the first string of the list governs its
    interpretation; if it is:
    - ["rgb"], then the list next 3 arguments are used to specify the
      red, green, and blue components of the color,
    - ["cmyk"], then the list next 4 arguments are used to specify the
      cyan, magenta, yellow, and black components of the color,
    - ["gray"] or ["grey"], then the list next argument is used to
      specify the amount of gray of the color.
    All the color component specifications are supposed to be floating
    point numbers string representation as understood by [float_of_string].

    [parse_color_args] never fails. In case something goes wrong
    during parsing, a medium gray (cmyk (0, 0, 0, 1/2) is returned.
*)