how do i get RGB from HEX?

Robin Becker robin at jessikat.fsnet.co.uk
Sat Mar 23 17:13:59 EST 2002


In article <a7iqan$s7o$0 at 216.39.172.122>, Bengt Richter <bokr at oz.net>
writes
......
>>
>>>>> def rgb(h):
>>...     n = eval('0x'+h[1:])
>>...     return (n>>16)&0xff, (n>>8)&0xff, n&0xff
>>... 
>>>>> rgb('#DCDC0a')
>             ,-^^
>             |
>            ???
>             |
>            vvv
>>(220, 220, 220)
......
yes that was me editing in pythonwin
-- 
Robin Becker



More information about the Python-list mailing list