def color_overlap(color1, *args):
args = list(args)<EOL>args.insert(<NUM_LIT:0>, color1)<EOL>rgba = np.asarray([<NUM_LIT:0.5>,<NUM_LIT:0.5>,<NUM_LIT:0.5>,<NUM_LIT:0>])<EOL>for c in args:<EOL><INDENT>c = to_rgba(c)<EOL>a = c[...,<NUM_LIT:3>]<EOL>a0 = rgba[...,<NUM_LIT:3>]<EOL>if   np.isclose(a0, <NUM_LIT:0>).all(): rgba = np.ones(rgba.shape) * c<EOL>elif np.isclose(a,  <NUM_LIT:0>).all(): continue<EOL>else:                         rgba = times(a, c) + times(<NUM_LIT:1>-a, rgba)<EOL><DEDENT>return rgba<EOL>
color_overlap(color1, color2...) yields the rgba value associated with overlaying color2 on top
  of color1 followed by any additional colors (overlaid left to right). This respects alpha
  values when calculating the results.
Note that colors may be lists of colors, in which case a matrix of RGBA values is yielded.