Game Development Community

Particles : colour reference

by Mr Meikel · in Torque Game Engine · 02/26/2006 (11:53 am) · 8 replies

Hi,

I'm attempting to make all of my guns have different particle effects, but cannot find any reference for the 4-digit numbers used in the datablocks.
eg:

colors[0] = "0.8 0.2 0 1.0";
colors[1] = "0.8 0.2 0 1.0";
colors[2] = "0 0 0 0.0";

My guess is a 3-digit RGB and then an alpha, but I could be very wrong! And of course RGB would be up to 255, not 0<=x<=1 !

So, anyone got a reference table/image they can share?

edit: also, can anyone recomend a particle tutorial? I've got ideas in my head, but no idea how to recreate them!

#1
02/26/2006 (1:00 pm)
Well, it's RGBA, but the values are from 0 to 1, instead of 0 to 255.
#2
02/26/2006 (2:55 pm)
Ah i see, thanks :)
#3
02/26/2006 (3:45 pm)
What would then be the scale for mixing colors then? 0-1 dosn't leave alot of room for color combos.
#4
02/26/2006 (3:57 pm)
Sure it does, you use decimals. Percentages. May be a little tedious in figuring out the right amount of each, but eventually it comes pretty easily.
#5
02/26/2006 (5:19 pm)
127 = 0.5? ..use photoshop as reference?
#6
02/26/2006 (5:56 pm)
That works.
#7
02/26/2006 (6:00 pm)
Just take your normal 0-255 color value and divide by 255 to convert it to your floating point.
#8
02/26/2006 (6:12 pm)
Quote:127 = 0.5? ..use photoshop as reference?

correct. The value IS (R, G, B, Alpha) as a 0-1 value. Just think of the color values as percentages from 0% to 100% except their reprecented as a decimal instead.

With a little basic math or a color converter (there's several online or you can make one) you should be able to represent just as many, if not more, color-combinations as with 0-255 values or Hex (00-FF) values.

For those who are art-deficent, like me, a trip to easyrgb.com can be helpfull too.