default colors for enum ColorMap type (#1428)
* default colors for enum ColorMap type * Update ColorMapWidget.py if to elif Co-authored-by: ALLENINST\stephanies <stephanies@alleninstitute.org>
This commit is contained in:
parent
4575decf6f
commit
b21967d20d
@ -71,7 +71,15 @@ class ColorMapParameter(ptree.types.GroupParameter):
|
||||
defaults = fieldSpec.get('defaults', {})
|
||||
for k, v in defaults.items():
|
||||
if k == 'colormap':
|
||||
item.setValue(v)
|
||||
if mode == 'range':
|
||||
item.setValue(v)
|
||||
elif mode == 'enum':
|
||||
children = item.param('Values').children()
|
||||
for i, child in enumerate(children):
|
||||
try:
|
||||
child.setValue(v[i])
|
||||
except IndexError('No default color set for child %s' % child.name()):
|
||||
continue
|
||||
else:
|
||||
item[k] = v
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user