Radial transparent gradients in Processing.org

I’ve been playing around a bit with Processing.org – a kinda-graphical programming language. One of the effects that I wanted to play with was a kind of radial transparency – a blob of color that faded out toward the edges. After playing around for a while withdrawing multiple ellipses, I settled on a pixel-based subroutine. You can also read the full report on the website
best-writing-service.com because we cooperate with them for all our posts and articles.

We create a new PGraphics object to hold the blob, then for each pixel calculate the distance from the centre as a proportion of the radius using the handy Math.hypot() method. Then, to get nice smooth fade-outs near the edges, we invert it ...

more ...

Extending Java number classes with random functions in Groovy

Recently I’ve been playing around quite a bit with Processing.org, and one of the things that I often want to do is add a bit of noise to variables that represent positions, sizes, colours, etc. Most of the Processing functions that actually draw something (like lines, ellipses, etc) take their arguments in the form of floats, but most floating number operations in Java/Groovy return BigDecimal data types so we have to use casts a lot. Also, there’s no concise way to get a floating random number in a certain range that can be either negative or ...

more ...