Module Color_brewery.Palette
Colormaps with certain characteristics.
val length : t -> int
length m
returns the number of colors in the palettem
.
val gradient : ?interpolate:bool -> t -> Gradient.t
gradient m
returns a gradient constructed from the palette. It only makes sense for sequential and some diverging palettes.- parameter interpolate
If
false
(the default), just map
val ty : t -> [ `Seq | `Div | `Qual ]
ty m
says whether the palette is`Seq
uential,`Div
ergent or`Qual
itative.
val blind : t -> [ `Yes | `No | `Maybe ]
blind m
says whether the palettem
is colorblind safe.
val print : t -> [ `Yes | `No | `Maybe ]
print m
says whether the palettem
is print friendly.
val copy : t -> [ `Yes | `No | `Maybe ]
print m
says whether the palettem
is photocopy safe.
val lcd : t -> [ `Yes | `No | `Maybe ]
print m
says whether the palettem
is friendly for LCD screens.
val 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 and having at least lengthlength
. Note that most of the palette have ≤ 12 colors 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.
val viridis : t
Matplotlib colormaps
These are sequential colormaps (each with 256 colors). You can find more information on this page.
ColorBrewer schemes
Sequential schemes
val ylgn : t list
Light yellow to dark green
val ylgnbu : t list
Light yellow to green to dark blue
val gnbu : t list
Light green to dark blue
val bugn : t list
Light blue to dark green
val pubugn : t list
Light purple to blue to dark green
val pubu : t list
Light purple to dark blue
val bupu : t list
Light blue to dark purple
val rdpu : t list
Light red to dark purple
val purd : t list
Light purple to dark red
val orrd : t list
Light orange to dark red
val ylorrd : t list
Light yellow to orange to dark red
val ylorbr : t list
Light yellow to orange to dark brown
Sequential schemes, single hue
val purples : t list
Light to dark purple
val blues : t list
Light to dark blue
val greens : t list
Light to dark green
val oranges : t list
Light to dark oranges
val reds : t list
Light to dark red
val greys : t list
Light to dark gray
Diverging schemes
val puor : t list
Dark orange to light to dark purple
val brbg : t list
Dark brown to light to dark blue-green
val prgn : t list
Dark reddish-purple to light to dark green
val piyg : t list
Dark magenta to light to dark yellow-green
val rdbu : t list
Dark red to light to dark blue
val rdgy : t list
Dark red to light to dark grey
val rdylbu : t list
Dark red to light yelow to dark blue
val spectral : t list
Dark red, orange, light yellow, green, dark blue
val rdylgn : t list
Dark red, orange, light yellow, yellow-green, dark green
Qualitative schemes
val set1 : t list
Includes bold, readily named, basic colors (such as red, green, blue)
val pastel1 : t list
Lighter version of
Set1
val set2 : t list
Includes mostly a mixture colors (such as blue-green, red-orange)
val pastel2 : t list
Lighter version of
Set2
val dark2 : t list
Darker version of
Set2
val set3 : t list
Medium saturation set with more lightness variation and more classes than
Set1
andSet2
.
val paired : t list
Light/dark paris for namable hues
val accent : t list
Include lightness and saturation extremes to accent small or important areas