Cleaned up colour conversion logic