Move colour conversion stuff to static methods in a util class