def _handle_topomap_bads(ch_name, params):
 for type in ('mag', 'grad', 'eeg', 'seeg', 'hbo', 'hbr'):
  if (type in params['types']):
   types = np.where((np.array(params['types']) == type))[0]
   break
 color_ind = np.where((np.array(params['info']['ch_names'])[types] == ch_name))[0]
 if (len(color_ind) > 0):
  sensors = params['fig_selection'].axes[1].collections[0]
  this_color = sensors._edgecolors[color_ind][0]
  if all((this_color == [1.0, 0.0, 0.0, 1.0])):
   sensors._edgecolors[color_ind] = [0.0, 0.0, 0.0, 1.0]
  else:
   sensors._edgecolors[color_ind] = [1.0, 0.0, 0.0, 1.0]
  params['fig_selection'].canvas.draw()

def _handle_topomap_bads ( ch_name , params ) : for type in ( 'mag' , 'grad' , 'eeg' , 'seeg' , 'hbo' , 'hbr' ) : if ( type in params [ 'types' ] ) : types = np . where ( ( np . array ( params [ 'types' ] ) == type ) ) [ 0 ] break color_ind = np . where ( ( np . array ( params [ 'info' ] [ 'ch_names' ] ) [ types ] == ch_name ) ) [ 0 ] if ( len ( color_ind ) > 0 ) : sensors = params [ 'fig_selection' ] . axes [ 1 ] . collections [ 0 ] this_color = sensors . _edgecolors [ color_ind ] [ 0 ] if all ( ( this_color == [ 1.0 , 0.0 , 0.0 , 1.0 ] ) ) : sensors . _edgecolors [ color_ind ] = [ 0.0 , 0.0 , 0.0 , 1.0 ] else : sensors . _edgecolors [ color_ind ] = [ 1.0 , 0.0 , 0.0 , 1.0 ] params [ 'fig_selection' ] . canvas . draw ( )
color channels in selection topomap when selecting bads .