Dr. Luciano Nocera
Color is the perception of a kind of light
Hue | Degree to which a stimulus can be described as similar to or different from stimuli that are described as red, orange, yellow, green, blue, and purple. |
---|---|
Saturation | Also called colorfulness, chroma, intensity, purity. It is the perceived intensity (chromatic strength) of a hue. |
Brightness | Attribute of a visual sensation according to which an area appears to emit more or less light. |
Color vision is the ability to discriminate light composed of different wavelengths
Eye has 3 kinds of color receptors roughly corresponding to blue, green and red
B⇆
S
G⇆
M
R⇆
L
Some colors are not seen |
|
Photoreceptor distribution does not relate to perceived colors |
|
Afterimages cannot be explained |
|
The visual system responds to opponent channels
The visual system records differences between the responses of cones, rather than each type of cone's individual response
Chromatic channel | red | vs. | green |
Chromatic channel | blue | vs. | yellow |
Achromatic channel | black | vs. | white |
Some text that is difficult to read for people with poor vision
As someone with protanomaly, I can see all colors, including red, it's just that red is noticeably weak and so it looks very dark to me. I often can't read black writing on a red background (or vice versa) and sometimes mistake purple with blue.
As someone with protanomaly, I can see all colors, including red, it's just that red is noticeably weak and so it looks very dark to me. I often can't read black writing on a red background (or vice versa) and sometimes mistake purple with blue.
Normal vision | All colors in visible spectrum | |
Deuteranopia Deuteranomaly |
Green, M cone M: $6.2\%$ F: $0.36\%$ |
|
Protanopia Protanomaly |
Red, L cone M: $2.6\%$ F: $0.04\%$ |
|
Tritanopia Tritanomaly |
Blue, S cone M: $0.01\%$ F: $0.03\%$ |
Practical guidance to color mixing and the visual effects of color combinations
Abstract mathematical model describing the way colors can be represented as tuples
Colors encoded as tuples: (red, green, blue, opacity)
8 bits per channel, i.e., 256x256x256 (~16.7M) colors
<div style="background-color: red">name</div> <!-- named colors: red ≡ (255, 0, 0) -->
<div style="background-color: rgba(255, 0, 0, 0.3);">rgba</div> <!-- rgb(,,) or rgba(,,,) -->
<!-- opacity = 55 → 85, 85/255 = 0.333 -->
<div style="background-color: #ff000055;">hex</div> <!-- #rgb or #rgba -->
Primaries
Mixed create all other colors
Cannot be mixed from other colors
|
3 primary colors
|
Secondary
|
3 secondary colors
mixed from 2 primaries |
Complementary
|
|
Addition of illumination | Projected colors overlap, e.g., stage projectors |
---|---|
Partitive mixing | Closely spaced colored dots, colors are next to each other, e.g., LCD screens |
Time mixing | OLED micro displays, rotating color wheels, sequential illumination |
Binocular mixing | Different colors on each eye, mixed by the brain |
True-color | False-color | Pseudocolor |
---|---|---|
Colors appear similar a viewer of the image and to an observer of the scene, i.e., RGB → RGB
|
Images in different spectral bands are combined into an RGB image, e.g., NRG → RGB, with N near-infrared band
False-color techniques include:
|
Derived from a grayscale image by mapping each intensity value to a color according to a table or function, e.g., G → RGB
|
Dark mode
We are more sensitive to dark than light differences
Scheme | Characteristics | Examples |
---|---|---|
Sequential | Ordered data, light colors for lower values to dark colors for higher values | |
Diverging | Critical class or break in the middle, sequential sequences of contrasting hues on both ends. | |
Qualitative | For nominal or categorical data. |
Respect well-established color sequences | |
Observe cultural conventions | |
Use color palettes for more attractive and effective displays |
Use consistent color encodings across graphics | |
Use colorblind safe colors | |
Use accessibility standards: AA (minimum) contrast ratio of 4.5:1 for all text |
//d3-color and d3-scale-chromatic are included in d3
//d3-color provides color manipulation and color space conversion.
var c = d3.hsl("steelblue");
console.log(c); //{h: 207.272, s: 0.44, l: 0.343, ...}
c = c.darker();
console.log(c); //{h: 207.272, s: 0.44, l: 0.490, ...}
c = c.brighter();
console.log(c); //{h: 207.272, s: 0.44, l: 0.490, ...}
//d3-scale-chromatic provides ColorBrewer and other colors schemes
var accent = d3.schemeAccent; //["#7fc97f", "#beaed4", "#fdc086", ...]
//d3-hsv needs to be loaded separately (npm install d3-hsv)
var yellow = d3.hsv("yellow"); // {h: 60, s: 1, v: 1, opacity: 1}
Input Domain Data |
Encoding $\longmapsto$ scale |
Ouput Range Colors |
Continuous | Discrete | |
---|---|---|
Continuous |
Linear Sequential Diverging |
Quantize Quantile |
Discrete |
Ordinal Threshold |
Library | Type | Description | Charts |
---|---|---|---|
d3-shape | Generator | Graphical primitives for visualization, such as lines and areas. | Line, area, pie charts, symbols... |
d3-chord | Layout | Relationships or network flow in circular layout. | Chord diagram |
d3-force | Layout | Force-directed graph layout using velocity Verlet integration. | Physical simulations in networks and hierarchies, bubbles charts... |
d3-hierarchy | Layout | 2D layout algorithms for visualizing hierarchical data. | Treemaps, dendrograms, circle-packing... |
d3-sankey | Layout | Directed flow between nodes in an acyclic network. | Sankey diagrams |
d3-hexbin | Generator | Group two-dimensional points into hexagonal bins. | Hexbins plots |
d3.histogram | Generator | Computes the histogram for the given array. | Histograms |