Simplifies the rgb_to_hex function'