PDA

View Full Version : color in the items table


Dymerius
08-16-2006, 09:07 AM
I would like to change the tint of some armor pieces (not dye) and I'm just curious how to manipulate the color field in the items table to get a desired result. All I really know so far is:

1 = Black

As the number increases, color goes through dark blue, then I haven't really tested it after about 500.

2147483647(max value) = White

I know higher values are... lighter in color... but I really need to understand how this variable works so I don't have to sit here trying every single number combination :p

Any suggestions?

Thanks in advance,

EmanonCow
08-17-2006, 03:29 AM
It is probably a packed RGB value.

If so, 16777215 will be White as well.

Do you know hex numbers?

The 6 diget hex number will probably be formatted like this:
RRGGBB

Each "channel" or component goes from 00 to FF (0 to 255 in decimal).

If Red, Green and Blue are from 0 to 255 each:
ColourNum = Red * 2^16 + Green * 2^8 + Blue
should display the RGB colour combination. (2^16 is "two to the power of 16", or 2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2.)

GeorgeS
08-21-2006, 02:02 PM
Use this program from my site to get the RGB (F6 copies HEX value)
the use as mentioned before ColourNum = Red * 2^16 + Green * 2^8 + Blue

http://66.159.225.58/eqemu/ColorDetector.zip

George

fathernitwit
08-24-2006, 01:27 PM
you can put the RGB hex values directly into mysql with 0x:

0xAARRGGBB
AA = alpha (transparency)
RR = reg
GG = green
BB = blue
in hex.

eg:
UPDATE items SET color=0xFFFF0000 WHERE id=1001;
should turn the cloth cap red.

I think you want to have an alpha of FF for solid colors (00 is completely transparent I think)... not sure though.

somebody should put this on the wiki.