This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Stripe WebGl Gradient Animation | |
| * ScrollObserver functionality to disable animation when not scrolled into view has been disabled and | |
| * commented out for now. | |
| */ | |
| //Converting colors to proper format | |
| function normalizeColor(hexCode) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| def supersample(clip, d, nframes): | |
| """ Replaces each frame at time t by the mean of `nframes` equally spaced frames | |
| taken in the interval [t-d, t+d]. This results in motion blur.""" | |
| def fl(gf, t): | |
| tt = np.linspace(t-d, t+d, nframes) | |
| avg = np.mean(1.0*np.array([gf(t_) for t_ in tt]),axis=0) | |
| return avg.astype("uint8") | |
| return clip.fl(fl) |