API Reference

Color palettes

Most functions listed above are exported and can be accessed directly via the colorspace package, such as colorspace.hcl_palettes(), colorspace.qualitative_hcl() and more.

hcl_palettes

Gives access to the default color palettes of the colorspace package.

qualitative_hcl

Qualitative HCL color palette.

sequential_hcl

Sequential HCL color palette.

diverging_hcl

Diverging HCL color palette.

rainbow_hcl

HCL rainbow, a qualitative cyclic rainbow color palette with uniform luminance and chroma.

heat_hcl

HEAT hcl, a sequential color palette.

terrain_hcl

HCL terrain colors, a sequential palette.

diverging_hsv

Diverging HSV color palette.

rainbow

Infamous rainbow palette.

palette

A class for custom color palettes with a fixed number of colors.

palettes.hclpalette

Hy, I am the base class.

GUI for choosing color palettes

Exported function, can be accessed via colorspace.choose_palette().

choose_palette

Graphical user interface to choose HCL based color palettes.

Assessing colors and palettes

specplot

Visualization of the RGB and HCL spectrum given a set of hex colors.

swatchplot

Create color palette swatch plots.

Color vision defficiency

CVD

Object to simulate color vision deficiencies (CVD) for protanope, deteranope, and tritanope visual constraints.

desaturate

Transform a vector of given colors to the corresponding colors with chroma reduced (by a tunable amount) in HCL space.

deutan

Simulate Color Vision Deficiency

protan

Simulate Color Vision Deficiency

tritan

Simulate Color Vision Deficiency

Color manipulation

max_chroma

Get maximum chroma for a specific combination of hue and luminance.

contrast_ratio

W3C Contrast Ratio

lighten

Algorithmically lighten colors.

darken

Algorithmically darken colors.

extract_transparency

Extracting alpha transparency.

adjust_transparency

Adjust alpha transparency.

Color library/color transformations

polarLUV

Create polarLUV (HCL) Color Object

HCL

alias of polarLUV

CIELUV

Create CIELUV Color Object

CIEXYZ

Create CIEXYZ Color Object

RGB

Create RGB Color Object

sRGB

Create Standard RGB (sRGB) Color Object

CIELAB

Create CIELAB Color Object

polarLAB

Create Polar LAB Color Object

HSV

Create HSV Color Object

HLS

Create HLS Color Object

hexcols

Create Hex Color Object