def rgb_to_yuv(r, g=None, b=None):
if type(r) in [list,tuple]:<EOL><INDENT>r, g, b = r<EOL><DEDENT>y =  (r * <NUM_LIT>) + (g * <NUM_LIT>) + (b * <NUM_LIT>)<EOL>u = -(r * <NUM_LIT>) - (g * <NUM_LIT>) + (b * <NUM_LIT>)<EOL>v =  (r * <NUM_LIT>) - (g * <NUM_LIT>) - (b * <NUM_LIT>)<EOL>return (y, u, v)<EOL>
Convert the color from RGB coordinates to YUV.

    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 (y, u, v) tuple in the range:
      y[0...1],
      u[-0.436...0.436],
      v[-0.615...0.615]

    >>> '(%g, %g, %g)' % rgb_to_yuv(1, 0.5, 0)
    '(0.5925, -0.29156, 0.357505)'