In computer science, the colouring algorithm is a simple look-up to virtual storage containing another stream to be parsed, to generate a function which acts on the original input.

This look-up may be performed recursively. The look-up is arbitrary and is defined by rules which are defined by virtual default streams. Each of these may be overridden, changed or removed by using an input stream. The problem with this lies in creating "enough" colouring to make all of this function. This is sometimes called "bootstrapping."

A variant of the coloring algorithm is known as the graph coloring algorithm. It is used in various allocation strategies, for example in register allocation in compiler development, and resource allocation in operating systems