mlpost
OCaml library on top of Metapost
1024" x-on:close-sidebar="sidebar=window.innerWidth > 1024 && true">
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
val default : t
the default color is black
val rgb : float -> float -> float -> t
rgb r g b
constructs the color that corresponds to the color code RGB(r,g,b)
val rgb8 : int -> int -> int -> t
rgb r g b
constructs the color that corresponds to the color code RGB(r,g,b)
similar to rgb
, but takes integers between 0 and 255 as argument
val cmyk : float -> float -> float -> float -> t
cmyk c m y k
constructs the color that corresponds to the color code CMYK(c,m,y,k)
WARNING : If you use transparency with .mps file in your latex document you need to add : \LoadMetaPostSpecialExtensions in the preamble
val rgba : float -> float -> float -> float -> t
similar to rgb
, but takes the factor of transparency
val rgb8a : int -> int -> int -> int -> t
similar to rgb8
, but takes the factor of transparency
val cmyka : float -> float -> float -> float -> float -> t
similar to cmyk
, but takes the factor of transparency
val is_opaque : t -> bool
test if the color is opaque
val hsv : float -> float -> float -> t
hsv h s v convert an hsv color to an rgb. 0 <= h < 360, 0 <= s,v <= 1
color generator
val color_gen : float -> float -> unit -> t
Predefined Colors
base colors
val white : t
val black : t
val red : t
val blue : t
val green : t
val cyan : t
val yellow : t
val magenta : t
lighter colors
val lightred : t
val lightblue : t
val lightgreen : t
val lightcyan : t
val lightyellow : t
val lightmagenta : t
grays
val gray : float -> t
val lightgray : t
val mediumgray : t
val darkgray : t
additional colors
val orange : t
val purple : t