def to_rgba(self, arg, alpha=None):
try:<EOL><INDENT>if not cbook.is_string_like(arg) and cbook.iterable(arg):<EOL><INDENT>if len(arg) == <NUM_LIT:4>:<EOL><INDENT>if [x for x in arg if (float(x) < <NUM_LIT:0>) or  (x > <NUM_LIT:1>)]:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if alpha is None:<EOL><INDENT>return tuple(arg)<EOL><DEDENT>if alpha < <NUM_LIT:0.0> or alpha > <NUM_LIT:1.0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>return arg[<NUM_LIT:0>], arg[<NUM_LIT:1>], arg[<NUM_LIT:2>], arg[<NUM_LIT:3>] * alpha<EOL><DEDENT>r,g,b = arg[:<NUM_LIT:3>]<EOL>if [x for x in (r,g,b) if (float(x) < <NUM_LIT:0>) or  (x > <NUM_LIT:1>)]:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>r,g,b = self.to_rgb(arg)<EOL><DEDENT>if alpha is None:<EOL><INDENT>alpha = <NUM_LIT:1.0><EOL><DEDENT>return r,g,b,alpha<EOL><DEDENT>except (TypeError, ValueError) as exc:<EOL><INDENT>raise ValueError('<STR_LIT>' % (str(arg), exc))<EOL><DEDENT>
Returns an *RGBA* tuple of four floats from 0-1.

For acceptable values of *arg*, see :meth:`to_rgb`.
If *arg* is an *RGBA* sequence and *alpha* is not *None*,
*alpha* will replace the original *A*.