Register to post in forums, or Log in to your existing account

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion

Joined: 23 Nov 2004
Posts: 364

PostPosted: Sun Dec 25, 2011 2:42 pm   

cmud mapper color codes
What is the encoding of the mapper's color codes? I started playing around with the map via an SQL database browser and the color numbers don't seem to be in any representation I'm familiar with. There are values such as 42495 and 536870911. I searched around a little and someone mentioned an RGB scheme, which I don't see possible from these numbers. Does anybody know how the colors in cmud are encoded?
Reply with quote

Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Dec 25, 2011 3:17 pm   
Computers store everything that has to do with numerics in decimal format. Those values are the decimal equivalents of RGB (or the Windows Color format, which is BGR).
EDIT: I didn't like my old signature
Reply with quote

Joined: 22 Mar 2007
Posts: 2320

PostPosted: Sun Dec 25, 2011 5:56 pm   
Why do you want to translate the numbers?

In the computer, the colors red, green, and blue can have 256 intensity values. That is represented by 8 bits. If you put the 8 red bits next to the 8 green bits next to the 8 blue bits, and translate all the bits into an integer value, you get the windows color value that is used in the map database. This windows color value is actually in the order BGR rather than RGB.

You can see the windows color value for any of the named colors with the %colorname() function. You can also translate the BGR windows color value into a hexadecimal RGB value with the %hexcolor() function. This will produce a 6 character hexadecimal string. The first two characters represent the red value in hexadecimal, the second two characters represent the green value in hexadecimal, and the last two characters represent the blue value in hexadecimal.

In general you aren't expected to directly use the windows color value. That is just for the computer to use. There isn't any way to translate it into a color name. What do you want to do with it?
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by