View Full Version : Color editing


Nitram15
Aug 01, 2011, 10: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?

Tholal
Aug 01, 2011, 12:21 PM
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.

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

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

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