module Color:sig..end
Color contains the color type and utilities for manipulating
colors.
type color = {
|
red : |
|
green : |
|
blue : |
|
alpha : |
}
The type of a color. Each of red, green, blue, and alpha
are in the range 0..255.
val rgb : int -> int -> int -> colorrgb r g b is the opaque color with red, green and blue values of r, g,
and b, respectively.
val rgba : int -> int -> int -> int -> colorrgba r g b a is rgb r g b, but with an alpha value of a.
val gray : int -> colorgray val is the opaque color represented by the grayscale value val,
which is equivalent to each of red, green, and blue values of val.
val graya : int -> int -> colorgray val a is gray val, but with an alpha value of a.
val hsv : int -> int -> int -> colorhsv h s v is the opaque color represented by the hue, saturation, and
value values of h, s, and v, respectively. h is in the range
0..360, and both s and v are in the range 0..100.
val hsva : int -> int -> int -> int -> colorhsva h s v a is hsv h s v, but with an alpha value of a. a is in the
range 0..255.
val hex : string -> colorhex hex_str is the color represented by hex_str in hexadecimal notation.
hex_str may or may not begin with a pound (#), and may specify alpha
(#AARRGGBB) or not (#RRGGBB).