parameters: (rep=None, value=None, separate=False)
docstring: Set scalar color. This will automatically setup the color maps and others
      necessary state for the representations. 'rep' must be the display
      properties proxy i.e. the value returned by GetDisplayProperties() function.
      If none is provided the display properties for the active source will be
      used, if possible. Set separate to True in order to use a separate color
      map for this representation
docstring_summary: Set scalar color. This will automatically setup the color maps and others
      necessary state for the representations. 'rep' must be the display
      properties proxy i.e. the value returned by GetDisplayProperties() function.
      If none is provided the display properties for the active source will be
      used, if possible. Set separate to True in order to use a separate color
      map for this representation
docstring_tokens: Set scalar color . This will automatically setup the color maps and others necessary state for the representations . rep must be the display properties proxy i . e . the value returned by GetDisplayProperties () function . If none is provided the display properties for the active source will be used if possible . Set separate to True in order to use a separate color map for this representation
function: def ColorBy(rep=None, value=None, separate=False):
      """Set scalar color. This will automatically setup the color maps and others
      necessary state for the representations. 'rep' must be the display
      properties proxy i.e. the value returned by GetDisplayProperties() function.
      If none is provided the display properties for the active source will be
      used, if possible. Set separate to True in order to use a separate color
      map for this representation"""
      rep = rep if rep else GetDisplayProperties()
      if not rep:
          raise ValueError ("No display properties can be determined.")
  
      rep.UseSeparateColorMap = separate
      association = rep.ColorArrayName.GetAssociation()
      arrayname = rep.ColorArrayName.GetArrayName()
      component = None
      if value == None:
          rep.SetScalarColoring(None, servermanager.GetAssociationFromString(association))
          return
      if not isinstance(value, tuple) and not isinstance(value, list):
          value = (value,)
      if len(value) == 1:
          arrayname = value[0]
      elif len(value) >= 2:
          association = value[0]
          arrayname = value[1]
      if len(value) == 3:
          # component name provided
          componentName = value[2]
          if componentName == "Magnitude":
            component = -1
          else:
            if association == "POINTS":
              array = rep.Input.PointData.GetArray(arrayname)
            if association == "CELLS":
              array = rep.Input.CellData.GetArray(arrayname)
            if array:
              # looking for corresponding component name
              for i in range(0, array.GetNumberOfComponents()):
                if componentName == array.GetComponentName(i):
                  component = i
                  break
                # none have been found, try to use the name as an int
                if i ==  array.GetNumberOfComponents() - 1:
                  try:
                    component = int(componentName)
                  except ValueError:
                    pass
      if component is None:
        rep.SetScalarColoring(arrayname, servermanager.GetAssociationFromString(association))
      else:
        rep.SetScalarColoring(arrayname, servermanager.GetAssociationFromString(association), component)
      rep.RescaleTransferFunctionToDataRange()
function_tokens: def ColorBy ( rep = None , value = None , separate = False ) : rep = rep if rep else GetDisplayProperties ( ) if not rep : raise ValueError ( "No display properties can be determined." ) rep . UseSeparateColorMap = separate association = rep . ColorArrayName . GetAssociation ( ) arrayname = rep . ColorArrayName . GetArrayName ( ) component = None if value == None : rep . SetScalarColoring ( None , servermanager . GetAssociationFromString ( association ) ) return if not isinstance ( value , tuple ) and not isinstance ( value , list ) : value = ( value , ) if len ( value ) == 1 : arrayname = value [ 0 ] elif len ( value ) >= 2 : association = value [ 0 ] arrayname = value [ 1 ] if len ( value ) == 3 : # component name provided componentName = value [ 2 ] if componentName == "Magnitude" : component = - 1 else : if association == "POINTS" : array = rep . Input . PointData . GetArray ( arrayname ) if association == "CELLS" : array = rep . Input . CellData . GetArray ( arrayname ) if array : # looking for corresponding component name for i in range ( 0 , array . GetNumberOfComponents ( ) ) : if componentName == array . GetComponentName ( i ) : component = i break # none have been found, try to use the name as an int if i == array . GetNumberOfComponents ( ) - 1 : try : component = int ( componentName ) except ValueError : pass if component is None : rep . SetScalarColoring ( arrayname , servermanager . GetAssociationFromString ( association ) ) else : rep . SetScalarColoring ( arrayname , servermanager . GetAssociationFromString ( association ) , component ) rep . RescaleTransferFunctionToDataRange ( )