File: cloud.mli

package info (click to toggle)
ocaml-cairo2 0.6.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 716 kB
  • sloc: ml: 2,955; ansic: 2,132; makefile: 24; sh: 17
file content (41 lines) | stat: -rw-r--r-- 1,134 bytes parent folder | download | duplicates (3)
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

open Cairo

type rgba = float * float * float * float

exception Failure

val make : context -> rectangle -> ?rotate:float -> ?padding:float ->
  ?word_box:(float -> rgba -> rectangle -> string -> unit) ->
  size:('a -> string -> float) -> ?min_size:float ->
  color:('a -> string -> rgba) ->
  ('a * string) list -> unit
  (** [make cr canvas size color words] make a cloud of the [words] in
      the rectangle [canvas] on the surface hold by [cr].  [size] and
      [color] must resp. return the text size and color for a given
      word.

      [word_box sz rgba r word] is executed once for each [word] where
      [sz] is the font size, [rgba] is the color of the word, and [r]
      is the rectangle reserved for that word.  This allows, for
      example, to generate an image map for the cloud. *)


module Palette :
sig
  type t = (float * float * float * float) array

  val random : t -> float * float * float * float

  val mauve : t
  val metal_blue : t
  val blue_green : t
  val brown : t
  val rainbow : t
  val winter : t
  val heat : t
  val blue_yellow : t
  val clay : t
  val gray : t
  val light_gray : t
end