Reputation: 1323
Is there a simple way to convert a number into a tkinter color (#ffeedd
).
I'm already setup to take the number and multiply it by 8 to give me a bit more color range leeway, and maybe even multiply it by 16 depending on just how much leeway I have to work with, not sure on how much leeway I will have yet... but I'm guessing I'll only be able to multiply by 8. How do I take that number and convert it over so I can use it with canvas.create_line((x,y), (x,y), fill = 'color')
. I tried hex(number)
but it just gives me back that color 0x0
doesn't exists... kinda figured that would happen but thought it would be worth a try.
a = 326
b = a * 8
canvas.create_line((x,y), (x,y), fill = b)
Upvotes: 5
Views: 876