def _reverse_cmap_spec(spec):
 if (u'listed' in spec):
  return {u'listed': spec[u'listed'][::(-1)]}
 if (u'red' in spec):
  return revcmap(spec)
 else:
  revspec = list(reversed(spec))
  if (len(revspec[0]) == 2):
   revspec = [((1.0 - a), b) for (a, b) in revspec]
  return revspec

def _reverse_cmap_spec ( spec ) : if ( u'listed' in spec ) : return { u'listed' : spec [ u'listed' ] [ : : ( - 1 ) ] } if ( u'red' in spec ) : return revcmap ( spec ) else : revspec = list ( reversed ( spec ) ) if ( len ( revspec [ 0 ] ) == 2 ) : revspec = [ ( ( 1.0 - a ) , b ) for ( a , b ) in revspec ] return revspec
reverses cmap specification *spec* .