View Full Version : Color editing

Aug 01, 2011, 09:49 AM
I've been creating mods for a while, and always stuck at the color editing.
I know how to create colors, add them to the game etc. but can't get the EXACT color I want.

Probably you don't understand me yet. I mean the colors in civ 4 are not the same RGB values than (ex.) Gimp RGB, the Civ 4 ones are Float values.

Now I have tons of values I want to implant, but all of them are in 0-255 format (tipycal RGB format).
For example I have:
R 9
G 79
B 150
then how can I calculate it to Civ 4 float format?

Aug 01, 2011, 11:21 AM
I believe the float values are percentages of the standard RGB values. So, for example, a value of 256 would convert to 1.0, while a value of 9 would convert to 0.03 (9 divided by 256).

And then of course, the fAlpha value is for transparency.

Aug 01, 2011, 11:30 AM
Huh, you seem to be right. Well, I shall try that. ;)

Aug 01, 2011, 02:15 PM
Simply divide the RGB value by 255, then input the first two digits of the decimal number you get.

Aug 01, 2011, 02:40 PM
Yup, I figured out now. :) And it seems to be working.