-
-
Save LeetCodes/8892d567f4d7f3304c27d446c7108830 to your computer and use it in GitHub Desktop.
Source code for http://low-sugar-eye-candy.tumblr.com/post/165871163208/what-came-first-amber-or-amber-screens
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
| W = 490 | |
| H = 475 | |
| def setup | |
| srand 333 | |
| frame_rate 10 | |
| end | |
| def draw | |
| if frame_count == 1 | |
| background 0 | |
| else | |
| fill 0, 40 | |
| no_stroke | |
| rect 0, 0, W, H | |
| filter BLUR, 1 | |
| filter ERODE | |
| end | |
| num = (frame_count - 1) % 100 | |
| @img = load_image "../scratch/travolta/frame-#{num}.png" | |
| @img.load_pixels | |
| text_font(create_font("PerfectDOSVGA437", 12), 12) | |
| textAlign(CENTER, CENTER) | |
| 0.step(H, 10) do |y| | |
| 0.step(W, 6) do |x| | |
| i = y * W + x | |
| c = @img.pixels[i] | |
| next if 0 == alpha(c) | |
| fill color('#FA9800'), brightness(c) * 1.5 | |
| text rand(33..128).chr, x, y | |
| end | |
| end | |
| stroke 0, 60 | |
| 0.step(H, 2) do |y| | |
| line 0, y, W, y | |
| end | |
| end | |
| def settings | |
| size W, H, JAVA2D | |
| smooth | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment