'Place the clip on a colored background.
Returns a clip made of the current clip overlaid on a color
clip of a possibly bigger size. Can serve to flatten transparent
clips.
Parameters
size
Size (width, height) in pixels of the final clip.
By default it will be the size of the current clip.
color
Background color of the final clip ([R,G,B]).
pos
Position of the clip in the final clip. \'center\' is the default
col_opacity
Parameter in 0..1 indicating the opacity of the colored
background.'

def on_color(self, size=None, color=(0, 0, 0), pos=None, col_opacity=None):

    from .compositing.CompositeVideoClip import CompositeVideoClip
    if (size is None):
        size = self.size
    if (pos is None):
        pos = 'center'
    colorclip = ColorClip(size, color)
    if (col_opacity is not None):
        colorclip = ColorClip(size, color, duration=self.duration).set_opacity(col_opacity)
        result = CompositeVideoClip([colorclip, self.set_pos(pos)])
    else:
        result = CompositeVideoClip([self.set_pos(pos)], size=size, bg_color=color)
    if (isinstance(self, ImageClip) and (not hasattr(pos, '__call__')) and ((self.mask is None) or isinstance(self.mask, ImageClip))):
        new_result = result.to_ImageClip()
        if (result.mask is not None):
            new_result.mask = result.mask.to_ImageClip()
        return new_result.set_duration(result.duration)
    return result
