Module CSS.Color
type name=The colors by name.
val string_of_name : name -> stringGives the string equivalent of the argument.
val rgb_of_name : name -> int * int * intConverts a color name into three integers representing the Red, Green and Blue channels. Channel values are in between
0and255.
val hex_of_rgb : (int * int * int) -> stringConvert a tuple of three integers between
0and255into a hex string
type t=|Name of nameA color by name
|RGB of int * int * intRed, Green and Blue values. Clipped to
0..255by most (All?) browsers.|RGB_percent of int * int * intRBG channels are specified as a percentage of their maximal value.
|RGBA of int * int * int * floatSame as RGB with additional transparency argument. Opacity should be between
0.(completely transparent) and1.(completely opaque).|RGBA_percent of int * int * int * floatRGB channels specified as percentage of their maximal value. Alpha channel (opacity) is still a
0.to1.float.|HSL of int * int * intHue, Saturation and Lightness values. Hue is an angle in degree (in interval
0..360). Saturation is a percentage (0..100) with0being colorless. Lightness is also a percentage (0..100) with0being black.|HSLA of int * int * int * floatSame as HSL with an opacity argument between
0.and1..The type of colors, either by name, by Red-Green-Blue constructor or by Hue-Saturation-Lightness constructors.
val rgb : ?a:float -> int -> int -> int -> tbuild a color from the values of red, green, and blue channels. optional
aargument can be used to specify alpha channel (aka opacity).
val hsl : ?a:float -> int -> int -> int -> tbuild a color from the values of hue, saturation, and lightness channels. optional
aargument can be used to specify alpha channel (aka opacity).
type js_t= private Js_of_ocaml.Js.js_string Js_of_ocaml.Js.tA
js_tis a valid string representation of a CSS color
val string_of_t : t -> stringConvert to a string representation (for debugging purpose mainly).
val js : t -> js_tProjection from OCaml to Js.
js cis equivalent toJs.string (string_of_t c)but with ajs_treturn type.
val js_t_of_js_string : Js_of_ocaml.Js.js_string Js_of_ocaml.Js.t -> js_tChecks the well-formedness of a string or fails with
Invalid_argument