RGB to hex
Converts the values of RGB components to a hexadecimal color code.
- Create a placeholder for a zero-padded hexadecimal value using
'{:02X}'
and copy it three times. - Use
str.format()
on the resulting string to replace the placeholders with the given values.