Martin Krzywinski / Canada's Michael Smith Genome Sciences Centre / mkweb.bcgsc.ca Martin Krzywinski / Canada's Michael Smith Genome Sciences Centre / mkweb.bcgsc.ca - contact me Martin Krzywinski / Canada's Michael Smith Genome Sciences Centre / mkweb.bcgsc.ca on Twitter Martin Krzywinski / Canada's Michael Smith Genome Sciences Centre / mkweb.bcgsc.ca - Lumondo Photography Martin Krzywinski / Canada's Michael Smith Genome Sciences Centre / mkweb.bcgsc.ca - Pi Art Martin Krzywinski / Canada's Michael Smith Genome Sciences Centre / mkweb.bcgsc.ca - Hilbertonians - Creatures on the Hilbert CurveMartin Krzywinski / Canada's Michael Smith Genome Sciences Centre / mkweb.bcgsc.ca - Pi Day 2020 - Piku
This love's a nameless dream.Cocteau Twinstry to figure it outmore quotes

blue: color


The Outbreak Poems — artistic emissions in a pandemic


visualization + design
If you are interested in color, explore my other color tools, Brewer palettes resources, color blindness palettes and math and an exhausting list of 10,000 color names for all those times you couldn't distinguish between tan hide, sea buckthorn, orange peel, west side, sunshade, california and pizzaz.

Designing for Color Blindess

Color choices and transformations for deuteranopia and other afflictions

Here, I help you understand color blindness and describe a process by which you can make good color choices when designing for accessibility. You can also delve into the mathematics behind the color blindness simulations.

Different color blindness simulations don't all agree on the luminance of the simulated color. See methods for details.

In an audience of 8 men and 8 women, chances are 50% that at least one has some degree of color blindness1,2. When encoding information or designing content, use colors that is color-blind safe.

1About 8% of males and 0.5% of females are affected with some kind of color blindness in populations of European descent (wikipedia, Worldwide prevalence of red-green color deficiency, JOSAA). The rate for other races is lower Asians and Africans is lower (Caucasian Boys Show Highest Prevalence of Color Blindness Among Preschoolers, AAO).

2The probability that among `N=8` men and `N=8` women at least one person is affected by color blindness is `P(men,women) = P(8,8) = 1 - (1-0.08)^8(1-0.005)^8 = 0.51`. For `N=34` (i.e., 68 people in total), this probability is `P(34,34)=0.95`. Because the rate of color blindness in women is so low, for most groups of mixed gender we can approximate the probability by only counting the men. For example, in a group of 17 women the probability that at least one of them is color blind is `P(0,17) = 0.082`, which is the same probability as for 1 man, `P(1,0)`.

color receptors are reduced or absent in color blindness

The normal human eye is a 3-channel color detector3. There are three types of photoreceptors, each sensitive to a different part of the spectrum. Their combined response to a given wavelength produces a unique response that is the basis of the perception of color.

3Compared to hearing, the color vision is a primitive detector. While we can hear thousands of distinct frequencies and process them simultaneously, we have only three independent color inputs. While the ear can distinguish pure tones from complex sounds that have multiple frequencies the eye is relatively unsophisticated in separating a color sensation into its three constituent primary stimuli.

People with color blindness have one of the photo receptor groups either reduced in number or entirely missing. With only two groups of photoreceptors, the perception of hue is drastically altered.

For example, in deuteranopia, the most common type of color blindness, the medium (M) wavelength photoreceptors are reduced in number or missing. This results in the loss of perceived difference between reds and greens because only one group of photoreceptors (L) are sensitive to the wavelengths of these colors. The spectrum appears to be split into two hues along the blue-green boundary (see figure below), which is roughly where the photoreceptor sensitivities curves cross.

Color photoreceptor profile for color blindness and the appearance of art and objects. / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Each of the three kinds of color blindness are associated with reduced number of each of the three kinds of photoreceptors. In extreme cases, a given type of photoreceptors may be missing. To people with color blindness, objects appear very differently. Artwork is (left) Edvard Munch, Scream (Skrik), 1893, National Gallery, Oslo, Norway (right) Claude Monet, Coquelicots, La promenade (Poppies), 1873, Musée d'Orsay, Paris. Each of the rows in the color ramps on the right show colors that are indistinguishable for each kind of color blindness. (zoom)

Visible light is in the range of 390–700 nm. The exact definition of the upper limit varies, with some sources giving as high as 760 nm. Shorter wavelengths are absorbed by the cornea (<295nm) and lens (315–390nm). Some near infrared light also reaches the retina (760–1,400nm).

it's all the same to me

The Ishihara test is a color perception test for protanopia and deuteranopia. Think of the Rorschach test, except with a different diagnosis if you can't see a pattern.

Traditionally, the Ishihara test is performed with digits but why not use Mr. Spock4. He knows all the digits and is much more insteresting.

4In tribute to Leonard Nimoy, 1931–2015

Spock, indistinguishable to people with color blindness. / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
The likeness of Mr. Spock drawn using equivalent colors (see image above) for each of the three kinds of color blindness. Image from imagebuddy. (zoom)

simulating color blindness

Color blindness comes in varying degrees and types. Let's consider total deuternanopia—where the M receptors are missing or completely dysfunctional. Because they only have two kinds of color receptors, someone with this condition will see only two dimensions of color.

To understand how to simulate color blindness we have to look briefly at how color can be represented. You're probaby familiar with the RGB color space—just one kind of many color spaces. The RGB coordinates of a color are a device-dependent output model—they tell a device, such as your monitor or TV how much of a pixel's red, green and blue to activate. Obviously, depending on which specific display panel we're talking about, the output color might actually look very different—it's a function of the actual phosphors and any calibration and adjustments.

It turns out that we can also specify color in terms of coordinates in a space based on the physiological response of the eye to the color. Since a normal eye has three photoreceptors whose sensitivity is centered on short (S), medium (M) and long (L) wavelengths, any given color (i.e. monochromatic light) creates a unique combination of S, M and L cone response.

Using a color's LMS coordinates we can simulate color blindness by modifying the coordinate that corresponds to the missing photoreceptor under the observations that (a) deuteranopes, for example, can distinguish white and greys from blues and greens and (b) colors for which the sensitivity of the missing photoreceptors is low should be perceived normally.

Using the LMS color space to simulate color blindness / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Color blindness can be simulated by considering a color's coordinates in LMS space. (zoom)

Because color blindess reduces the number of color dimensions, a large number of colors distinguishable to people with normal vision appear the same to someone with color blidness. The ramps below show these families of equivalent colors.

Color palettes and selections for color blindness / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Sets of representative hues and tones that are indistinguishable to individuals with different kinds of color blindness. (zoom)

super color vision

The opposite condition to color blindness exists too—tetrachromacy. In this case, an individual has an extra type of color receptor which improves discrimination in the red part of the spectrum. While the anatomy of their retina can be described, how true tetrachromats subjectively perceive color is unknown. And, perhaps, even unknowable.

Tetrachromacy is common in other animals, such as fish (e.g. goldfish, zebrafish) and birds (e.g. finch, starling). The dimensionality of the perceived color space isn't necessarily proportional to the number of different receptors. If the signal from 3 color receptors are combined by the brain and each processor has a weighted response to a broad range of wavelengths, then a color can be modeled by a point in 3-dimensional space, in which the receptors are the axes. This system can perceive a large number of colors.

In the extreme case where the receptors respond to a very narrow range, of which none overlap with the other, a color is one of three points in a 1-dimensional space. This sytem can perceive only 3 colors.

For example, although the mantis shrimp has 12 different color receptors, the receptors work independently, their color discrimination is poorer than ours.

VIEW ALL

news + thoughts

The SEIRS model for infectious disease dynamics

Thu 18-06-2020

Realistic models of epidemics account for latency, loss of immunity, births and deaths.

We continue with our discussion about epidemic models and show how births, deaths and loss of immunity can create epidemic waves—a periodic fluctuation in the fraction of population that is infected.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Nature Methods Points of Significance column: The SEIRS model for infectious disease dynamics. (read)

This column has an interactive supplemental component (download code) that allows you to explore epidemic waves and introduces the idea of the phase plane, a compact way to understand the evolution of an epidemic over its entire course.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Nature Methods Points of Significance column: The SEIRS model for infectious disease dynamics. (Interactive supplemental materials)

Bjørnstad, O.N., Shea, K., Krzywinski, M. & Altman, N. (2020) Points of significance: The SEIRS model for infectious disease dynamics. Nature Methods 17:557–558.

Background reading

Bjørnstad, O.N., Shea, K., Krzywinski, M. & Altman, N. (2020) Points of significance: Modeling infectious epidemics. Nature Methods 17:455–456.

Gene Machines

Fri 05-06-2020

Shifting soundscapes, textures and rhythmic loops produced by laboratory machines.

In commemoration of the 20th anniversary of Canada's Michael Smith Genome Sciences Centre, Segue was commissioned to create an original composition based on audio recordings from the GSC's laboratory equipment, robots and computers—to make “music” from the noise they produce.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Gene Machines by Segue. Now available on vinyl.

Virus Mutations Reveal How COVID-19 Really Spread

Mon 01-06-2020

Genetic sequences of the coronavirus tell story of when the virus arrived in each country and where it came from.

Our graphic in Scientific American's Graphic Science section in the June 2020 issue shows a phylogenetic tree based on a snapshot of the data model from Nextstrain as of 31 March 2020.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Virus Mutations Reveal How COVID-19 Really Spread. Text by Mark Fischetti (Senior Editor), art direction by Jen Christiansen (Senior Graphics Editor), source: Nextstrain (enabled by data from GISAID).

Cover of Nature Cancer April 2020

Mon 27-04-2020

Our design on the cover of Nature Cancer's April 2020 issue shows mutation spectra of patients from the POG570 cohort of 570 individuals with advanced metastatic cancer.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Each ellipse system represents the mutation spectrum of an individual patient. Individual ellipses in the system correspond to the number of base changes in a given class and are layered by mutation count. Ellipse angle is controlled by the proportion of mutations in a class within the sample and its size is determined by a sigmoid mapping of mutation count scaled within the layer. The opacity of each system represents the duration since the diagnosis of advanced disease. (read more)

The cover design accompanies our report in the issue Pleasance, E., Titmuss, E., Williamson, L. et al. (2020) Pan-cancer analysis of advanced patient tumors reveals interactions between therapy and genomic landscapes. Nat Cancer 1:452–468.

Modeling infectious epidemics

Tue 16-06-2020

Every day sadder and sadder news of its increase. In the City died this week 7496; and of them, 6102 of the plague. But it is feared that the true number of the dead this week is near 10,000 ....
—Samuel Pepys, 1665

This month, we begin a series of columns on epidemiological models. We start with the basic SIR model, which models the spread of an infection between three groups in a population: susceptible, infected and recovered.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Nature Methods Points of Significance column: Modeling infectious epidemics. (read)

We discuss conditions under which an outbreak occurs, estimates of spread characteristics and the effects that mitigation can play on disease trajectories. We show the trends that arise when "flattenting the curve" by decreasing `R_0`.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Nature Methods Points of Significance column: Modeling infectious epidemics. (read)

This column has an interactive supplemental component (download code) that allows you to explore how the model curves change with parameters such as infectious period, basic reproduction number and vaccination level.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Nature Methods Points of Significance column: Modeling infectious epidemics. (Interactive supplemental materials)

Bjørnstad, O.N., Shea, K., Krzywinski, M. & Altman, N. (2020) Points of significance: Modeling infectious epidemics. Nature Methods 17:455–456.