parameters: (color1, color2)
docstring: Uses 1-norm distance to calculate difference between two values.
docstring_summary: Uses 1-norm distance to calculate difference between two values.
docstring_tokens: Uses 1 - norm distance to calculate difference between two values .
function: def _color_diff(color1, color2):
      """
      Uses 1-norm distance to calculate difference between two values.
      """
      if isinstance(color2, tuple):
          return sum([abs(color1[i] - color2[i]) for i in range(0, len(color2))])
      else:
          return abs(color1 - color2)
function_tokens: def _color_diff ( color1 , color2 ) : if isinstance ( color2 , tuple ) : return sum ( [ abs ( color1 [ i ] - color2 [ i ] ) for i in range ( 0 , len ( color2 ) ) ] ) else : return abs ( color1 - color2 )