parameters: (argcolor, saptcolor)
return_statement: return clr
docstring: Find appropriate color expression between overall color directive
      *argcolor* and particular color availibility *rxncolor*.
docstring_summary: Find appropriate color expression between overall color directive
      *argcolor* and particular color availibility *rxncolor*.
docstring_tokens: Find appropriate color expression between overall color directive * argcolor * and particular color availibility * rxncolor * .
function: def segment_color(argcolor, saptcolor):
      """Find appropriate color expression between overall color directive
      *argcolor* and particular color availibility *rxncolor*.
  
      """
      import matplotlib
  
      # validate any sapt color
      if saptcolor is not None:
          if saptcolor < 0.0 or saptcolor > 1.0:
              saptcolor = None
  
      if argcolor is None:
          # no color argument, so take from rxn
          if rxncolor is None:
              clr = 'grey'
          elif saptcolor is not None:
              clr = matplotlib.cm.jet(saptcolor)
          else:
              clr = rxncolor
      elif argcolor == 'sapt':
          # sapt color from rxn if available
          if saptcolor is not None:
              clr = matplotlib.cm.jet(saptcolor)
          else:
              clr = 'grey'
      elif argcolor == 'rgb':
          # HB/MX/DD sapt color from rxn if available
          if saptcolor is not None:
              if saptcolor < 0.333:
                  clr = 'blue'
              elif saptcolor < 0.667:
                  clr = 'green'
              else:
                  clr = 'red'
          else:
              clr = 'grey'
      else:
          # color argument is name of mpl color
          clr = argcolor
  
      return clr
function_tokens: def segment_color ( argcolor , saptcolor ) : import matplotlib # validate any sapt color if saptcolor is not None : if saptcolor < 0.0 or saptcolor > 1.0 : saptcolor = None if argcolor is None : # no color argument, so take from rxn if rxncolor is None : clr = 'grey' elif saptcolor is not None : clr = matplotlib . cm . jet ( saptcolor ) else : clr = rxncolor elif argcolor == 'sapt' : # sapt color from rxn if available if saptcolor is not None : clr = matplotlib . cm . jet ( saptcolor ) else : clr = 'grey' elif argcolor == 'rgb' : # HB/MX/DD sapt color from rxn if available if saptcolor is not None : if saptcolor < 0.333 : clr = 'blue' elif saptcolor < 0.667 : clr = 'green' else : clr = 'red' else : clr = 'grey' else : # color argument is name of mpl color clr = argcolor return clr