Page
Library
Module
Module type
Parameter
Class
Class type
Source
Archimedes.ColorAbstract representation of colors (suitable for RGBA).
val rgb : float -> float -> float -> trgb r g b creates the color with transparency ~a, red component r, green component g and blue component b. All values must be between 0. and 1.; raises Invalid_argument otherwise.
val rgba : float -> float -> float -> float -> trgba r g b a creates the color with transparency ~a, red component r, green component g and blue component b. All values must be between 0. and 1.; raises Invalid_argument otherwise.
val int : int -> tint c returns a color from its specification as an integer whose value is 0xRRGGBB where R, G and B are hexadecimal digits giving the red, green, and blue components of that color.
It is the form used by Graphics.
val hue : float -> thue h returns a color of given hue h in the interval [0 .. 360.[ (h is reduced modulo 360.) and of maximal luminance.
val r : t -> floatReturns the red component of a color.
val g : t -> floatReturns the green component of a color.
val b : t -> floatReturns the blue component of a color.
val a : t -> floatReturns the transparency (alpha) component of a color.
val get_rgb : t -> float * float * floatEquivalent to (r t,g t,b t).
val get_rgba : t -> float * float * float * floatEquivalent to (r t,g t,b t, a t).
val luminance : t -> floatval black : tval red : tval green : tval blue : tval yellow : tval magenta : tval cyan : tval white : tval dark_slate_grey : tval colors : t listThe list of all predefined colors.
val deep_sky_blue : tval dodger_blue : tval aquamarine : tval light_blue : tval medium_blue : tval royal_blue : tval burlywood : tval chocolate : tval tan : tval dark_green : tval dark_olive_green : tval forest_green : tval green_yellow : tval sea_green : tval dark_orange : tval peach_puff : tval coral : tval orange : tval hot_pink : tval indian_red : tval light_pink : tval misty_rose : tval orange_red : tval firebrick : tval dark_orchid : tval lavender_blush : tval plum : tval orchid : tval purple : tval thistle : tval antique_white : tval old_lace : tval ivory : tval linen : tval wheat : tval white_smoke : tval lemon_chiffon : tval light_goldenrod : tval cornsilk : tval gold : tval light_gray : tval gainsboro : tval silver : tval trolley_grey : ttype operator = | OverTransparency and color components are mixed in such a way that it corresponds to putting the second color over the first
*)| SourceFirst color completely ignored.
*)| ClearInhibits all colors
*)| InRGB components as the second color, A component product of the two A components. So, a transparent color result if the first one was transparent.
*)| OutRGB components as the second color, A component product of the second A component with (1 - A) first component. So, a transparent color result if the first one was opaque.
*)| AtopTransparency of the first color is the final transparency; mixes RGB components.
*)| DestSecond color completely ignored. (<-> SOURCE)
*)| Dest_OverTransparency and color components are mixed in such a way that it corresponds to putting the first color over the second. (<-> OVER)
*)| Dest_InRGB components as the first color, A component product of the two A components. So, a transparent color result if the second one was transparent. (<-> IN)
*)| Dest_OutRGB components as the first color, A component product of the first A component with (1 - A) second component. So, a transparent color result if the second one was opaque. (<-> OUT)
*)| Dest_AtopTransparency of the second color is the final transparency; mixes RGB components. (<-> ATOP)
*)| XorSame mix of color than OVER, but transparency will be more important.
*)| AddRGB components: ponderated sum of RGB components, with transparency. Resulting A is the sum of transparencies (bounded to 1. if necessary).
*)| SaturateSame as ADD, but the sum for RGB components shrinks the ponderation the first color components (coeff: min (first A, 1 - second A))
*)Different ways of merging colors. See http://cairographics.org/operators/ for more explanations.
Adds the first color to the second color, according to the operator op (default : Over).
lighten c v Lighten the color c of v percent. 0 corresponds to the same color, 1 corresponds to the white color.
darken c v Darken the color c of v percent. 0 correspond to the same color, 1 corresponds to the black color.