Skip to content

Instantly share code, notes, and snippets.

@fjenett
Created March 31, 2010 07:16
Show Gist options
  • Select an option

  • Save fjenett/350038 to your computer and use it in GitHub Desktop.

Select an option

Save fjenett/350038 to your computer and use it in GitHub Desktop.
// draw a rect filled with diagonal stripes
void setup ()
{
size( 200, 200 );
}
void draw ()
{
background(255);
int x = 20, y=20, w=width-40, h=height-40;
stroke( 0xFFFF9900 ); noFill();
for ( int ss = 5; ss < w+h ; ss += 5 )
{
//stroke( ss > h ? (ss > w ? 0xFF00FF00 : 0xFFFF0000) : 0 );
line( ss <= h ? x : x-h+ss,
ss <= h ? y+ss : y+h,
ss <= w ? x+ss : x+w,
ss <= w ? y : y-w+ss
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment