Refine colour macros, add Distance function, plus some "tests".