How can I convert an RGB integer to the corresponding RGB tuple (R,G,B)
? Seems simple enough, but I can't find anything on google.
I know that for every RGB (r,g,b)
you have the integer n = r256^2 + g256 + b
, how can I solve the reverse in Python, IE given an n
, I need the r
,g
,b
values.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…