package color-brewery

  1. Overview
  2. Docs
Offer colors palettes and functions to brew colors

Install

Dune Dependency

Authors

Maintainers

Sources

color-brewery-0.1.tbz
sha256=746215745d2faa5fb150fdb96e3b80d882040b828085db25b8f902577d5c4849
sha512=c833e2398b4870a5ab9a51da8bc0c5e420ce8ab068174a9606ed66afb48e65304c3f39a533ab4ee4f16647e1df60e1c677cf432eb37d0d088576e9ef5eb5b4db

doc/color-brewery/Color_brewery/index.html

Module Color_brewerySource

Colors palettes and functions to brew colors.

  • version 0.1
Sourcetype rgba = Gg.color

A RGBA color.

Sourcetype cmyk = Gg.v4

A CMYK color.

Sourceval to_int : rgba -> int

to_int c converts the color to 0xRRGGBB where RR, GG and BB are the red, green and blue values expressed on 2 hexadecimal digits. The alpha value is ignored. This is convenient to interact, say, with the Graphics module.

Sourceval of_int_exn : ?a:float -> int -> rgba

of_int_exn i returns the color provided as 0xRRGGBB.

  • parameter a

    the transparency component of the color. Default: 0.

Sourceval of_int : ?a:float -> int -> rgba option

of_int is the similar to of_int_exn except that it returns None instead of raising an exception.

Sourceval to_string : rgba -> string

to_string c converts the color to a string of the form #RRGGBB.

“Continuous” color ranges

Sourceval hue : float -> rgba

hue h return the color corresponding to the hue h ∈ [0., 360.).

Sourceval hue_pct : float -> rgba

hue h return the color corresponding to the hue h ∈ [0., 1.).

Sourcemodule Gradient : sig ... end
Sourceval range : ?grad:Gradient.t -> n:int -> float -> float -> (float * rgba) list

range ~n a b generates a uniform sampling of n points between a and b (with the bounds a and b included in the list of points) together with colors (based on hue at the moment).

  • parameter grad

    generate colors using the given gradient. Default: use the hue.

Sourceval with_colors : ?grad:Gradient.t -> 'a list -> ('a * rgba) list

with_colors l add a color range to the list l.

  • parameter grad

    generate colors using the given gradient. Default: use the hue.

Color palettes

Sourcemodule Palette : sig ... end

Find a color map according to certain characteristics.

OCaml

Innovation. Community. Security.