Changing Colours…

10 05 2010

Well I’ve spent a while trying to get the balls to change color dynamically sing the arch-os data.

I was able to find a way to change the color using setRGB(); from here.

The problem was that you had to define the colors it would change to using hex numbers. I had hoped to find a way to change colors using RGB values. That way I could have used 3 different random values from the arch-os array (one for the R value, one for G and one for B).

Another problem was actually trying to get values that were usable with hex values. The arch-os data spits out negative and decimal numbers. -102.52 doesn’t fit with the strict color values (between 00 and FF for hex and 0 to 255). Its easy to put the values as hole numbers using math.round and to invert the negative numbers using maths.abs. What I’m not sure how to do is to ensure that the number is 2 digits (for RGB) or convert it to a hex value. I’m sure it wouldnt be too hard, would just require a bit of research.

However, before I went any further I did a small test run. I used the code from earlyer for the hex values, but split it into three variables. For example setRGB(0x (var1)(var2)(var3) where var1 = 00, var2=11 and var3=22. This of course didn’t work.

With time running out on this project, and my final year project deadline rapidly approaching I decided not to peruse this area of the project any further. I’m not sure it would add a huge amount anyway.

Instead I plant on spending the reminder of my time tidying things up. I will remake the menu buttons add an info box explaining how to use it and make the code a little less buggy.

Advertisement

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.