Added colour conversion function.