def rgb_to_greyscale(r, g=None, b=None):
if type(r) in [list,tuple]:<EOL><INDENT>r, g, b = r<EOL><DEDENT>v = (r + g + b) / <NUM_LIT><EOL>return (v, v, v)<EOL>
Convert the color from RGB to its greyscale equivalent

    Parameters:
      :r:
        The Red component value [0...1]
      :g:
        The Green component value [0...1]
      :b:
        The Blue component value [0...1]

    Returns:
      The color as an (r, g, b) tuple in the range:
      the range:
      r[0...1],
      g[0...1],
      b[0...1]

    >>> '(%g, %g, %g)' % rgb_to_greyscale(1, 0.8, 0)
    '(0.6, 0.6, 0.6)'