Logo Home | Download | Submit | Screenshots | FAQ | SF Project Page | JUDO Help | Contact

View a Program

To run this program in JUDO, select the Program Code with your mouse, click the Edit menu of your browser and Copy. Then click in the code area of JUDO, click the Edit menu of JUDO and then Paste. Then Run the program.

Author Name:Edac Leinad
Program Name:Gradient with basic masking
Program Description:Hello all,

This program draws a gradient on screen. Unfortunately it is very slow due to the way JUDO is run, however it works.

I added a random polygon mask. Why? No clue.

When you run the program, three buttons litter the upper left hand corner. The first, closest to the top, redraws a new gradient with different colors. The second toggles the polygon mask. The third generates a new random polygon.

The program works by starting at a point (the center of the window) and working its way out with a double for loop, one for angle of the gradient, and one for distance away from the center. It then calculates a percent of how far away the particular point being generated is with respect to the gradient radius, then uses that percentage with the alpha blend to calculate the new color.

This program has quite a few bugs, I haven't had the chance to iron them out. One, I noticed, had to do with the gradient {r=500,source=white,destination=blue}. Oh well.

There are a few flags and values to tweak in function java.awt.Polygon generateRandomPolygon(), like max/min radius of the polygon, number of points and so forth. (point number is something good not to set too high)

Anyhow, hope it is useful to somebody somewhere. I might, later, update it and post it on my site, Maybe.

Email me at flyndgs[at]gmail[dot]com for questions or help.

Program Type:Graphics
Program Code:

Last Modified Sun Dec 22 07:25:00 UTC 2013
Thomas Dunn

Home | Download | Submit | Screenshots | FAQ | SF Project Page | JUDO Help | Contact