Skip to content

Commit d4ce492

Browse files
committed
Python 3 fix: spectrum_states TypeError
1 parent 56a55ab commit d4ce492

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spectrum_states.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def spectrum_states(selection='all', representations='cartoon ribbon',
7878
p0, p1 = int(floor(p)), int(ceil(p))
7979
ii = (p - p0)
8080
col_list = [colvec[p1][j] * ii + colvec[p0][j] * (1.0 - ii) for j in range(3)]
81-
col_name = '0x%02x%02x%02x' % (col_list[0] * 255, col_list[1] * 255, col_list[2] * 255)
81+
col_name = '0x%02x%02x%02x' % tuple(int(0xFF * v) for v in col_list)
8282
for s in settings:
8383
cmd.set(s, col_name, selection, state=i + first)
8484

0 commit comments

Comments
 (0)