Module OcsfmlGraphics.Color

module Color: sig .. end

type t = {
   r : int; (*Red component.*)
   g : int; (*Green component.*)
   b : int; (*Blue component.*)
   a : int; (*Alpha (opacity) component.*)
}
Utility class for manpulating RGBA colors.

sf::Color is a simple color class composed of 4 components:

Each component is an integer in the range 0, 255.

The fourth component of colors, named "alpha", represents the opacity of the color. A color with an alpha value of 255 will be fully opaque, while an alpha value of 0 will make a color fully transparent, whatever the value of the other components is.

Colors can also be added and modulated (multiplied) using the overloaded operators Infix.+% and Infix.*%.

val rgb : int -> int -> int -> t
Construct the color from its 3 RGB components (alpha is set to 255).
Returns Color constructed from the 3 RGB components.
val rgba : int -> int -> int -> int -> t
Construct the color from its 4 RGBA components.
Returns Color constructed from the 4 RGBA components.
val add : t -> t -> t
Compute the the component-wise sum of two colors. Components that exceed 255 are clamped to 255.
Returns Result of the sum.
val modulate : t -> t -> t
Compute the the component-wise multiplication (also called "modulation") of two colors. Components are then divided by 255 so that the result is still in the range 0, 255.
Returns Result of the multiplication.
val white : t
White predefined color.
val black : t
White predefined color.
val red : t
White predefined color.
val green : t
White predefined color.
val blue : t
White predefined color.
val yellow : t
White predefined color.
val magenta : t
White predefined color.
val cyan : t
White predefined color.
module Infix: sig .. end