Just a quick note for those trying this, depending on how you save out your colors from Igor, you may need to change the delimiter on Line 18. For example, I saved my colors as a csv (the default for Igor Pro v7 I think), and I changed line 18 to
df = pd.read_csv(fn, names=['R', 'G', 'B'], delimiter=',')
Please let us know if you have any troubles with it.
-Bence