tatman blue

I've started playing with various XNA tutorials available on the net. I see several examples where colors are made from Vector4 structures. So my question is:

is there any resources for looking up Vector4 values to know which one to use for a given color

In paint I get arb values (which is between 0 and 255) and it looks like I need to convert that to vectors which use values between 0 and 1.

Re: Game Technologies: General Colors, RGB values and vector confusion


usually the color's components are stored between 0 and 1 like you said, to convert from the 0 - 255 to 0 - 1 just divide the value of each component by 255.
The use of vector4 instead of vector3 is because of the alpha channel. The alpha channel has the opacity or transparency of the color which is usually also a value between 0 (completely transparent) and 1 (opaque).

As for tools to do what you want, well I don't know any from memory now but you could use Color.FromArgb in many cases to get a color using 0 - 255 values.