Stk.Color
Colors.
to_int8s color
returns (red, green, blue, alpha)
components of color.
of_rgba r g b a
returns a color from the given components.
of_rgba_0_1 r g b a
returns a color from the given components as floats. Each component must be between 0.
and 1.
and is multiplicated by 255 to get the value on one byte for this component. Out of bounds values are corrected to be at least 0 and at most 255.
Returns a color from a hexadecimal string representation. With each character being 0
..9
or a|A
..f|F
, accepted forms are:
"rgb"
, mapped to (rr,gg,bb,FF),"rgba"
, mapped to (rr,gg,bb,aa),"rrggbb"
, mapped to (rr,gg,bb,FF),s
which can be parsed by Int32.of_string ("0x"^s)
.Raises Failure
if the representation is invalid.
Thes named colors corresponds to the SVG color specification.
val aliceblue : t
val antiquewhite : t
val aqua : t
val aquamarine : t
val azure : t
val beige : t
val bisque : t
val black : t
val blanchedalmond : t
val blue : t
val blueviolet : t
val brown : t
val burlywood : t
val cadetblue : t
val chartreuse : t
val chocolate : t
val coral : t
val cornflowerblue : t
val cornsilk : t
val crimson : t
val cyan : t
val darkblue : t
val darkcyan : t
val darkgoldenrod : t
val darkgray : t
val darkgreen : t
val darkgrey : t
val darkkhaki : t
val darkmagenta : t
val darkolivegreen : t
val darkorange : t
val darkorchid : t
val darkred : t
val darksalmon : t
val darkseagreen : t
val darkslateblue : t
val darkslategray : t
val darkslategrey : t
val darkturquoise : t
val darkviolet : t
val deeppink : t
val deepskyblue : t
val dimgray : t
val dimgrey : t
val dodgerblue : t
val firebrick : t
val floralwhite : t
val forestgreen : t
val fuchsia : t
val gainsboro : t
val ghostwhite : t
val gold : t
val goldenrod : t
val gray : t
val green : t
val greenyellow : t
val grey : t
val honeydew : t
val hotpink : t
val indianred : t
val indigo : t
val ivory : t
val khaki : t
val lavender : t
val lavenderblush : t
val lawngreen : t
val lemonchiffon : t
val lightblue : t
val lightcoral : t
val lightcyan : t
val lightgoldenrodyellow : t
val lightgray : t
val lightgreen : t
val lightgrey : t
val lightpink : t
val lightsalmon : t
val lightseagreen : t
val lightskyblue : t
val lightslategray : t
val lightslategrey : t
val lightsteelblue : t
val lightyellow : t
val lime : t
val limegreen : t
val linen : t
val magenta : t
val maroon : t
val mediumaquamarine : t
val mediumblue : t
val mediumorchid : t
val mediumpurple : t
val mediumseagreen : t
val mediumslateblue : t
val mediumspringgreen : t
val mediumturquoise : t
val mediumvioletred : t
val midnightblue : t
val mintcream : t
val mistyrose : t
val moccasin : t
val oldlace : t
val olive : t
val olivedrab : t
val orange : t
val orangered : t
val orchid : t
val palegoldenrod : t
val palegreen : t
val paleturquoise : t
val palevioletred : t
val papayawhip : t
val peachpuff : t
val peru : t
val pink : t
val plum : t
val powderblue : t
val purple : t
val red : t
val rosybrown : t
val royalblue : t
val saddlebrown : t
val salmon : t
val sandybrown : t
val seagreen : t
val seashell : t
val sienna : t
val silver : t
val skyblue : t
val slateblue : t
val slategray : t
val slategrey : t
val snow : t
val springgreen : t
val steelblue : t
val tan : t
val teal : t
val thistle : t
val tomato : t
val turquoise : t
val violet : t
val wheat : t
val white : t
val whitesmoke : t
val yellow : t
val yellowgreen : t
val of_name : string -> t
val named_colors : t list
The list of named colors.
val random : unit -> t
random ()
returns a random color from the list of named colors.
val ocf_wrapper : t Ocf.wrapper
Ocf
.wrapper for a color.