Inspired by this - http://whatcolourisit.com/
I decided to add a little extra to my scripts. Just something small that wont improve the performance or anything. Basically there for cosmetic reasons
How to:
Add yer start time:
long startTime;
Then in onStart add:
public void onStart() throws InterruptedException {
startTime = System.currentTimeMillis();
}
Then make a timeToHex method:
public static String timeToHex (long time) {
int sec = (int) (time / 1000), h = sec / 3600, m = sec / 60 % 60, s = sec % 60;
return "#" + (h < 10 ? "0" + h : h)+(m < 10 ? "0" + m : m)+ (s < 10 ? "0" + s : s);
}
Then in onPaint add:
public void onPaint(Graphics2D g) {
super.onPaint(g);
long timeRan = (System.currentTimeMillis() - startTime);
Color timeColor = Color.decode(timeToHex(timeRan));
g.setColor(timeColor);
}
Now the colour timeColor will change the more you run the script
Fruity.