@requires_duration
def fadeout(clip, duration, final_color=None):
 if (final_color is None):
  final_color = (0 if clip.ismask else [0, 0, 0])
 final_color = np.array(final_color)
 def fl(gf, t):
  if ((clip.duration - t) >= duration):
   return gf(t)
  else:
   fading = ((1.0 * (clip.duration - t)) / duration)
   return ((fading * gf(t)) + ((1 - fading) * final_color))
 return clip.fl(fl)

@ requires_duration def fadeout ( clip , duration , final_color = None ) : if ( final_color is None ) : final_color = ( 0 if clip . ismask else [ 0 , 0 , 0 ] ) final_color = np . array ( final_color ) def fl ( gf , t ) : if ( ( clip . duration - t ) >= duration ) : return gf ( t ) else : fading = ( ( 1.0 * ( clip . duration - t ) ) / duration ) return ( ( fading * gf ( t ) ) + ( ( 1 - fading ) * final_color ) ) return clip . fl ( fl )
makes the clip progressively fade to some color .