here HEX2RGB return dict value after conversion like {r:255,g:255,b:255}
rgbValue=HEX2RGB(hex,'dict')
r,g,b={rgbValue} # not working
so how can I assign value of each key r,g,b in the variables r,g,b like above method? or is there any other efficient way?
r,g,b = rgbValue.values()HEX2RGBalready support producing a tuple (seems like it supports something, since'dict'is an argument rather than a hard-coded assumption)?rgbValue.values()can give (b,g,r), (g,b,r) etc, I think Roman's first answer is good one. More fancy and unnecessary one can ber,g,b = map(rgbValue.__getitem__, ('r', 'g', 'b'))