Working off Jeremy\'s response here: Converting hex color to RGB and vice-versa I was able to get a python program to convert preset colour hex codes (example #B4FBB8), howe
There are two small errors here!
hex == input("")
Should be:
user_hex = input("")
You want to assign the output of input()
to hex
, not check for comparison. Also, as mentioned in comments (@koukouviou) don't override hex
, instead call it something like user_hex
.
Also:
print(hex_to_rgb(hex()))
Should be:
print(hex_to_rgb(user_hex))
You want to use the value of hex, not the type's callable method (__call__
).