package color-brewery

  1. Overview
  2. Docs

Module Color_brewery.PaletteSource

Find a color map according to certain characteristics.

Based on colors maps by Cynthia A. Brewer, Penn State. See www.ColorBrewer.org

Sourcetype t

A color map from which one can extract various color ranges.

Sourceval length : t -> int

length m returns the length of the longest color range in m.

Sourceval rgb_exn : t -> int -> rgba list

rgb_exn m i returns the RGB color range containing i colors from m. If i > length m, Invalid_argument is raised.

Sourceval cmyk_exn : t -> int -> cmyk list

rgb_exn m i returns the CMYK color range containing i colors from m. If i > length m, Invalid_argument is raised.

Sourceval find : ?ty:[ `Seq | `Div | `Qual ] -> ?blind:[ `Yes | `No | `Maybe ] -> ?print:[ `Yes | `No | `Maybe ] -> ?copy:[ `Yes | `No | `Maybe ] -> ?lcd:[ `Yes | `No | `Maybe ] -> int -> t list

find length return the list of palettes that support the desired properties for the length length. Note that the maximum length is 12 and the longer the palette, the less it will satisfy other properties. For properties selected with `Yes `No or `Maybe, setting `No (the default) means one does not care, setting `Maybe selects palettes that maybe (or for sure) satisfy the property and `Yes selects palettes that satisfy the property for sure.

  • ty, if provided, restricts maps to the color scheme:

    • `Seq: Sequential scheme
    • `Div: Diverging scheme
    • `Qual: Qualitative scheme
  • blind: the palette should be safe for color blind people.
  • print: the palette is print friendly.
  • copy: the palette is photocopy friendly.
  • lcd: the palette is LCD friendly.

Color schemes

Color schemes as described in the paper: Brewer, Cynthia A., Geoffrey W. Hatchard and Mark A. Harrower, 2003, ColorBrewer in Print: A Catalog of Color Schemes for Maps, Cartography and Geographic Information Science 30(1): 5-32.

Sequential schemes

Sourceval ylgn : t

Light yellow to dark green

Sourceval ylgnbu : t

Light yellow to green to dark blue

Sourceval gnbu : t

Light green to dark blue

Sourceval bugn : t

Light blue to dark green

Sourceval pubugn : t

Light purple to blue to dark green

Sourceval pubu : t

Light purple to dark blue

Sourceval bupu : t

Light blue to dark purple

Sourceval rdpu : t

Light red to dark purple

Sourceval purd : t

Light purple to dark red

Sourceval orrd : t

Light orange to dark red

Sourceval ylorrd : t

Light yellow to orange to dark red

Sourceval ylorbr : t

Light yellow to orange to dark brown

Sequential schemes, single hue

Sourceval purples : t

Light to dark purple

Sourceval blues : t

Light to dark blue

Sourceval greens : t

Light to dark green

Sourceval oranges : t

Light to dark oranges

Sourceval reds : t

Light to dark red

Sourceval greys : t

Light to dark gray

Diverging schemes

Sourceval puor : t

Dark orange to light to dark purple

Sourceval brbg : t

Dark brown to light to dark blue-green

Sourceval prgn : t

Dark reddish-purple to light to dark green

Sourceval piyg : t

Dark magenta to light to dark yellow-green

Sourceval rdbu : t

Dark red to light to dark blue

Sourceval rdgy : t

Dark red to light to dark grey

Sourceval rdylbu : t

Dark red to light yelow to dark blue

Sourceval spectral : t

Dark red, orange, light yellow, green, dark blue

Sourceval rdylgn : t

Dark red, orange, light yellow, yellow-green, dark green

Qualitative schemes

Sourceval set1 : t

Includes bold, readily named, basic colors (such as red, green, blue)

Sourceval pastel1 : t

Lighter version of Set1

Sourceval set2 : t

Includes mostly a mixture colors (such as blue-green, red-orange)

Sourceval pastel2 : t

Lighter version of Set2

Sourceval dark2 : t

Darker version of Set2

Sourceval set3 : t

Medium saturation set with more lightness variation and more classes than Set1 and Set2.

Sourceval paired : t

Light/dark paris for namable hues

Sourceval accent : t

Include lightness and saturation extremes to accent small or important areas

OCaml

Innovation. Community. Security.