mirror of
https://github.com/metafy-social/python-scripts.git
synced 2024-11-24 12:31:11 +00:00
11 lines
312 B
Python
11 lines
312 B
Python
def rgb_to_hex(rgb):
|
|
return '%02x%02x%02x' % rgb
|
|
|
|
|
|
print("Enter the value of RGB color in (X,Y,Z) format:")
|
|
X = int(input("Enter value of X: "))
|
|
Y = int(input("Enter value of Y: "))
|
|
Z = int(input("Enter value of Z: "))
|
|
hex = rgb_to_hex((X, Y, Z))
|
|
print("The hexadecimal value is: {}" .format(hex))
|