mirror of
https://github.com/metafy-social/python-scripts.git
synced 2025-02-20 07:12:05 +00:00
rgb-to-hex added
This commit is contained in:
parent
6a98d2c044
commit
a6fefe0f63
10
scripts/RGB_To_Hexa/rgb-to-hex.py
Normal file
10
scripts/RGB_To_Hexa/rgb-to-hex.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
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))
|
Loading…
Reference in New Issue
Block a user