Latest entry:

Colourful lies you learned before high school

(January 12, 2018)

The primary colours cannot be mixed from other colours. This is one of the fundamental lessons from an elementary school art education. Did you know you can mix fire engine red using yellow and magenta?

Wait, what?

Colour printers use cyan (sort of a powder blue), magenta, yellow and black ink, and they make scarlets and crimsons just fine. I knew this, but I was still surprised when I learned that red was a colour that could be derived from others. I’d never thought too hard about this contradiction between what I was taught as the truth about colour and my own observations of the world. Well, it turns out there's a rich history of humans struggling to find the primaries so I really don’t feel too bad.

In this (very long) webpage the author surveys 300 years of inaccurate or incomplete attempts at modelling colour, concluding that primaries would have to either be purely imaginary constructs or inadequate for creating the full spectrum of colour (this is because colour saturation goes down every time you mix paint or light colours). I am fascinated by both the human drive to figure it out, and the hubris of ignoring the pieces of reality that didn’t fit nicely into the model du jour.

So getting back to what I promised in the title: what other things did we learn about colour in school that aren’t quite right?

The different kinds of colour complements

Green is said to be the complement of red. Why does it clash so much, then? Middle school colour theory tends to conflate the visual complement of a colour and the mixing complement of a paint pigment or light.


The visual complement of a given colour is the colour against which it looks the most vibrant. Red’s visual complement is a blueish turquoise. You can see this for yourself by staring at a bright red object for 20 seconds, then looking at a white surface. What colour is the afterimage?

Other visual complement pairs (determined in the same way) are:

You can make some fun outfits based on these pairs, by the way. Using visual complement pairs is one way to create harmony in a colour scheme.

This is a colour wheel in which opposites along the wheel are visual complements of each other.

Handprint Colour Wheel

Light mixing

If you take a light mixing complement pair, then draw or paint densely packed dots alternating between the two colours on a piece of paper and then squint at it from far away, you should see a perfect neutral grey (if you get the proportion of one colour to the other correct). You are looking at the average between two different colours without mixing the physical paints. There will never be a neutral grey between red and yellow of course, but you won’t find one between red and green either.

Take a look at some of the middle colours in this gradient. It goes from green to reddish green to greenish red to red without going anywhere near grey! They are definitely not light mixing complements (and, against intuition and all manner of opponent process-based colour models, reddish green is a valid description of a colour).

Paint mixing

Where did the idea of red being opposite to green come from, then? Red pigments mix with (blue-ish) green pigments to make neutral greys, so green and red are (near) paint mixing complements. There’s not much to say here. I think middle school got mixing complements mostly right. There are some interesting textural effects from interactions between heavy metal-based pigments and "smaller" and "lighter" synthetic pigments, but that's not really important unless you are Really Into Watercolour.

Paint mixing complements, enumerated what?

You don't need a perfect understanding of how brains and eyes process colour to make or appreciate good art. Look around and question any prescriptive rules about what colours do and do not go together. There are some great examples outside, because nature never got the memo about what should and shouldn't work :) And if you know a kid, mix a primary (or two) in front of them. That's cyan + magenta = blue, and yellow + magenta = red. Highly entertaining all around.

5 tons of flacs

(July 25, 2015)

Here are some things I learned and remembered on the way to writing a flac decoder in C++11. I actually wrote most of this up in April, but I found this post sitting here basically done, so out it goes.

Gstreamer0.10 without Pulseaudio

(March 06, 2015)

You used to be able to configure gstreamer0.10-using applications to output sound using OSSv4 via gconf; I had the following in $XDG_CONFIG_HOME/gconf/system/gstreamer/0.10/default/%gconf.xml:

<?xml version="1.0"?>
  <entry name="audiosrc" mtime="1390923248" type="string">
  <entry name="videosrc" mtime="1390923248" type="string">
  <entry name="videosink" mtime="1390923248" type="string">
  <entry name="audiosink" mtime="1390923248" type="string">

It wasn't working after I reinstalled Linux on a new SSD (I suspected my old drive was starting to fail). It appears gstreamer now uses GSettings/dconf, so instead I ran the following in a bash prompt. music-audiosink was the only one I needed to get audio working in luakit, but I figured that setting the rest of them couldn't hurt.

gsettings set org.freedesktop.gstreamer-0.10.default-elements music-audiosink oss4sink
gsettings set org.freedesktop.gstreamer-0.10.default-elements chat-audiosink oss4sink
gsettings set org.freedesktop.gstreamer-0.10.default-elements sounds-audiosink oss4sink

If you're using plain old ALSA, you can replace that with the following.

gsettings set org.freedesktop.gstreamer-0.10.default-elements music-audiosink alsasink
gsettings set org.freedesktop.gstreamer-0.10.default-elements chat-audiosink alsasink
gsettings set org.freedesktop.gstreamer-0.10.default-elements sounds-audiosink alsasink

Also useful for exploration are list-keys and get, which are used in this manner:

gsettings list-keys org.freedesktop.gstreamer-0.10.default-elements
gsettings get org.freedesktop.gstreamer-0.10.default-elements music-audiosink

More entries: