Created
February 5, 2012 05:56
-
-
Save timrandg/1743317 to your computer and use it in GitHub Desktop.
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
| # This sketch demonstrates how to use | |
| # Ruby-Processing. | |
| def setup | |
| size 450, 450 | |
| smooth | |
| background 255 | |
| end | |
| def draw | |
| grid(30,30,10,[0,0],[200,200,255]) | |
| grid(4,10,10,[30,30],[50,50,50]) | |
| grid(14,8,10,[60,50],[200,160,0]) | |
| end | |
| def grid(r,c,size,transpose=[0,0],colors=[100,100,100]) | |
| fill *colors | |
| start_x,y = transpose | |
| width,height = size,size | |
| #stroke = 200 | |
| r.times do | |
| x = start_x | |
| c.times do | |
| rect x,y,width,height | |
| x += width | |
| end | |
| y += height | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment