rewrote get_colour function