I have a function that returns a float from 0 to 255. I would like to make a gradient in red color from this, but I need a string in "#FFFFFF" format. Is there a function for that?
I'm now getting "not all arguments converted during string formatting" error. Tryed putting numbers instead of x, rounding x, truncating it, still the same error. Am I missing something?
akalenuk
2008-12-25 11:14:52
It should be: "#%02X0000" % x (I.e. the "%" is missing).
PEZ
2008-12-25 11:16:59
Thanks! Works fine now.
akalenuk
2008-12-25 11:21:09
+1, now that it's fixed :)
Ali A
2008-12-25 16:03:09
Whoops, thanks for that S.Lott. :)
Greg Hewgill
2008-12-25 17:51:52