Tutorial Hexadecimal and color codes

bOb666777

Stand against the ugly world domination face!
Reaction score
117
I noticed a lot of people needed help from a special program or a website to know what color codes meant what color. And I just thought this would help them make their own color codes faster, without needing a reference.

Let's get started

So, what exactly is hexadecimal and what's the link between it and color codes?

Hexadecimal (also known as Hex, Hexa and Base-16) is a numeral system that uses 16 as a base number. A 6 digits number with 0x before it means it is in hexadecimal. Your everyday numeral system is called decimal. We will use it as a comparison to the hexadecimal system. Decimal uses 10 as a base, and hexadecimal uses 16. That means the second number is worth 16, and the third, 256, and so on always multiplying by 16.

So, to obtain the decimal equivalent of an hex number, you multiply the number at the first digit by 1, then you multiply the 2nd digit by 16, add it to your current sum, then multiply the third digit by 256, and add it to the current sum, and so on.
Basically,
Code:
Hex       Decimal
0x000001 = 1
0x000010 = 16
0x000100 = 256
0x000021 = 33
0x001000 = 4096

As numbers go on, it can get hard to calculate, a calculator could be useful. Especially if it has a hex to dec and dec to hex function.

But then you ask, yeah but, if 0x000009 is 9 and 0x000010 is 16, what are 10, 11, 12, 13, 14 and 15? They are represented by letters, 10 being A, 11 being B, 12 being C, 13 being D, 14 being E and 15 being F.

so,
Code:
Hex       Decimal
0x00000C = 12
0x00001F = 31
0x0000FF = 255
0x00004A = 74

Oh, that's cool... I guess.... But how will that help me make color codes?

Color codes are made out of 3 groups of 2-digits hex numbers. Each group is a color. You probably noticed a lot of colorings (like Art - Tinting Color, in object editor) use 3 numbers located between 1 and 255. And what's the biggest 2 digits number we can have in hex (not including 0's)? 0xFF, or 255. Makes sense now? Well yeah, a color code is made like this: |cff (opening tag for a color code in wc3*) + 3 hex numbers, without 0x, because the game already knows those numbers are hex.
The first number is the amount of red in the tint, the second is green and the third is blue.
So a color code like this:
Code:
|cffFFFFFF
would equal to 255 red, 255 green and 255 blue, which is white.

Let's have more examples:
Code:
|cff00FF00
That would be 0 red, 255 green and 0 blue. That would make the text green.

Code:
|cff404040
That would be 64 red, 64 green and 64 blue. That would make a dark gray text.

Code:
|cffBB00BB
That would be 187 red, 0 green and 187 blue. That would make a light purple-violet-ish color.

--------------------
There is technically no end tag for a color code, but you want to make the text white again, so you can use |cffFFFFFF, although there is a shortcut to that: |r. It's the same thing as |cffFFFFFF. It's just shorter to write :D.

__________________
*The real opening tag is |c, but people will usually use |cff, because the color codes actually use 4 groups of numbers, and the first is transparency, but most people will leave it at FF.

That will be all, if you have any question, or think a part of this is hard to understand, let me know, I will try to answer your question and improve the tutorial.
 

Romek

Super Moderator
Reaction score
963
We've got about 60 of these types of tutorials. So don't count on this one getting approved. Sorry.
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
But I searched and I found none...

What's with that.....

Edit:

I searched those words:
Color - No result
Hexadecimal - No result
Colour - 1 result

Found one, but it's not exactly as good, IMO. Using Colour Codes
It just gives you a list of numbers you can use. Mine is actually explaining what those numbers mean.
 

Romek

Super Moderator
Reaction score
963
Pineapples one is more informative and better explained than this one.
And, it's still the same thing.

There's also this one.

I'm sure there were more. They probably were written, just not approved for the same reason as this one.
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
Bleh, I disagree, but I guess I can't really do anything about your choice...... :(
 

Igor_Z

You can change this now in User CP.
Reaction score
61
May i suggest this link.. It has fully constructed color codes, just change the # with |cff and it will work in wc3... I will try to learn ur system, i didn't know that color codes r constructed that way... Thanks for the info, +rep for u
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
Ummmm, thanks, but that's the opposite of the point of this tut, which is to make it so you don't need a color sheet like that anymore, because it takes forever to find an appropriate color in those.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top