Write a python function to convert the values of RGB components to a hexadecimal color code.


Topic: Write a python function to convert the values of RGB components to a hexadecimal color code.

Solution

def rgb_to_hex(r, g, b):
  return ('{:02X}' * 3).format(r, g, b)



List all Python Programs