 |
chris-74269 Magician
Joined: 23 Nov 2004 Posts: 364
|
Posted: 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?
|
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: 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? |
|
|
 |
|
|