Game is using ARGB color space which has 4 different channels, Alpha, Red, Green, Blue which is why it is called ARGB. Besides the regular red, green an blue channels, there is an additional alpha channel. The alpha channel is normally used as an opacity channel. If a pixel has a value of 0% in its alpha channel, it is fully transparent (and, thus, invisible), whereas a value of 100% in the alpha channel gives a fully opaque pixel.
In ARGB color space, each channel is defined by an 8 bit number. Since there are 4 channels and each channel is defined by an 8 bit number, it gives a total of 32 bits for each color. So each color can be represented by a number which is 32 bits long, stored in memory as a 32 bit unsigned integer. As shown on the image below.
* Image taken from Wikipedia, the free encyclopedia (http://en.wikipedia.org)
Since its not practical to write numbers with 32 digits every time we want to write a color somewhere, we can transform those binary numbers to hexadecimal numbers, so we can represent each color by number which only has 8 digits and each digit has 16 values, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. So this means we can represent each channel with 2 digits.
For example, if we want a red color, our hexadecimal value would be FFFF0000. The first 2 digits FF are representing alpha channel, which is in this case set to a maximum value, 100%. Second 2 digits are red channel, which is in this case also set to a a maximum value, 100%. Third 2 digits are blue channel, which is set to a minimum value of 00, which means there is no blue color. Fourth and last 2 digits are green channel, which is also set to a minimum value of 00, which means there is no green color.
To make things a little more difficult, the game is actually using decimal numbers at a processing level, so every input needs to contain a color value represented in decimal numbers. So what we have to do is take that hexadecimal value and turn it into a decimal value. I will not go into details of how to do that, a simple google search for "how to convert hexadecimal to decimal numbers" will provide over 600 thousand results. There are also online converters for this job, or it can even be done with the calculator provided with Windows OS.
So red color represented in hexadecimal value of FFFF0000 converts to decimal value 4294901760.
4294901760 is the number we are going to use to send a text in red color.
We get to a conclusion that there are exactly 2[sup]32[/sup] − 1 colors available, which is equal to 4294967295 (four billion two hundred ninety-four million nine hundred sixty-seven thousand two hundred and ninety-fifth). Please note that it was possible to write a number bigger than 4294967295 and the game was representing it as some color. This is because the game used 32 bit unsigned integers to store color values, if we use a larger number than 4294967295, a buffer overflow will happen. That basically means that the counter will reset and the game will start counting from 0 again. At some point they decided to stop that from happening and basically added an if statement, if the number is larger than 4294967295, use the number 4294967295. So at this point writing higher values than 4294967295 will just end up being 4294967295 which basically a white color.
The code to write in colors can be found below:
- \1c - This part tells the game that there is a color value coming up ahead.
- 4294967295 - This is the decimal value of the color in which text should be displayed.
- # - This means the color decimal value ends here and everything beyond that should be displayed in that specific color.
- Some text - Text that should be displayed in that specific color.
So basically all you have to do is paste this code before your text. This works on all chats. It is possible to use multiple colors in the same message, although this code will take up a portion message length.
This section contains a table of the most common colors. Please note that I did not name these colors myself, they were taken from W3Schools at http://www.w3schools.com/tags/ref_colornames.asp
. It is possible to paste the ingame code directly to ingame chat by pressing CTRL+V to paste. So if you're using these tables, there is no need for any conversions.
|Color||Color name||HEX Value||Decimal value||Ingame code|
|█████||Light Sea Green||FF20B2AA||4280332970||\1c4280332970#|
This section contains a table of the most common colors used throughout the game.
|Color||Used in||HEX Value||Decimal value||Ingame code|
|█████||Autotrack links in logbook||FF006400||4278215680||\1c4278215680#|
|█████||Item names in logbook||FFFFCC00||4294953984||\1c4294953984#|
|█████||Special notes in logbook||FF0000FF||4278190335||\1c4278190335#|
|█████||Special headings in logbook||FF008080||4278222976||\1c4278222976#|
|█████||Normal item color||FFFFFFFF||4294967295||\1c4294967295#|
|█████||Ordinary item color||FF0AF804||4278908932||\1c4278908932#|
|█████||Superior item color||FF6B0082||4285202562||\1c4285202562#|
|█████||Perfect item color||FFFF4800||4294920192||\1c4294920192#|
|█████||Precious item color||FFFF0000||4294901760||\1c4294901760#|
|█████||Public chat color||FF7FFAFB||4278222976||\1c4278222976#|
|█████||Inter city chat color||FF00D428||4278244392||\1c4278244392#|
|█████||Guild chat color||FF6DB9FF||4285381119||\1c4285381119#|
|█████||Guild bulletin color||FFB8FF3B||4290314043||\1c4290314043#|
|█████||Private chat color||FFA8FF00||4289265408||\1c4289265408#|
|█████||Team chat color||FF00CFC3||4278243267||\1c4278243267#|
|█████||Popular chat color||FFDFB943||4292852035||\1c4292852035#|
|█████||Popular chat city name color||FFF26522||4294075682||\1c4294075682#|
|█████||War chat color||FFDCDC10||4292664336||\1c4292664336#|
|█████||Newbie chat color||FFE14599||4292953497||\1c4292953497#|