Modularising colour calculations.