Skip to content

Instantly share code, notes, and snippets.

@macklinu
Created December 2, 2012 23:31
Show Gist options
  • Save macklinu/4191578 to your computer and use it in GitHub Desktop.
Save macklinu/4191578 to your computer and use it in GitHub Desktop.
Processing Conditional Thing
// THIS...
if (dist(mouseX, mouseY, X2 - 35, Y2 - 35) < 10) fill(190, 190);
else fill(90, 190);
// BECOMES...
fill(dist(mouseX, mouseY, X2 - 35, Y2 - 35) < 10 ? 190 : 90, 190);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment