knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

A brief primer of color theory

Color is a mix of wavelengths

Numerically represented as coordinates in a color space. Common color spaces: sRGB, CMYK, CIE L*a*b*

Color spaces associated with a color representation mode: RGB, CMYK, Lab, HSV, HCL.

Why you should care (and how chroma helps)

Difference between how the eye perceives color and how we represent it. Reprensentations meant for the computer (e.g. RGB) do not relate to how we perceive colors and that can result in mis-representation of the changes in the data along a color scale. Typical of rainbow() [refs].

Great care taken in the analysis of data. Equal care should be taken in the representation of the results

chroma is not a color management system, it only knowns sRGB. It helps by providing functions in color modes that are perceptually correct (HCL) and access to color scales designed in such spaces or with color perception in mind. It also provides access to corner use cases (temperature, wavelength, topo scales). Based on chroma.js.

Parse and convert colors

hex

css

rgb, rgba

cmyk

lab

hsv, hsl, hsi

hcl, lch

conversion

temperature, wavelength

Manipulate colors

manipulate individual channels

darken/lighten

saturate/desaturate

compute and change luminance

make transparent

Computing with colors

mix, average, blend

color distance

contrast, distance, CMClc, Delta-E

Color scales

description

Interpolating between colors

H, C, L scales

viridis-family scales

ColorBrewer scales

CubeHelix scale

Topographic scales



jiho/chroma documentation built on Nov. 26, 2022, 2:39 a.m.