SA-MP Color Defines
#18

Quote:
Originally Posted by Dark_Kostas
View Post
You can use any variety of colors you want. Its simple RGB in hexademical.
And you can make up to, 16581375 colors(without alpha, 255[R]*255[G]*255[B])
Exactly, i'll try to explain it a bit further.

Hexadecimal is just a different numbering system that is based on powers of 16, instead of 10. Its an odd concept at first, but you get used to it.

let's compare our decimal numbering system (base 10) against hexadecimal (base 16):

Decimal:

Code:
0,1,2,3,4,5,6,7,8, and 9
Hexadecimal:

Code:
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
A-F can be viewed as a sort of "place holder" where their value is just +1 of the previous. So A is 10, F is 15. Pretty easy to understand right?

lets take a look at counting:

Code:
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Notice how after 9 was reached, we added a new place with the value of 1, and the continue counting up? Its the same with hex

Code:
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F //15
10 //16 
11
12
Basically an easy way to think about this is that it works by powers of 16. Lets take 1A as an example

1a = 26. How do i know? i'll show you:

1 * 16^1 + 10 * 16^0. So 16+10=26. Maybe that was to easy, lets try FFFF!

15 * 16^3 + 15 * 16 ^ 2 + 15 * 16 ^ 1 + 15 * 16 ^ 0.

which is:

61440+3840+240+15 = 65535, which is completely right.

So basically its: VALUE * 16 to the power of the current place :P.


</end pointless nerdy rant>
Reply


Messages In This Thread
SA-MP Color Defines - by killer98p - 07.07.2010, 20:13
Re: SA-MP Color Defines - by tanush - 07.07.2010, 21:16
Re: SA-MP Color Defines - by Mystique - 07.07.2010, 21:24
Re: SA-MP Color Defines - by tanush - 07.07.2010, 21:26
Re: SA-MP Color Defines - by Miikkel - 07.07.2010, 22:38
Re: SA-MP Color Defines - by tanush - 18.07.2010, 23:36
Re: SA-MP Color Defines - by snoob - 19.07.2010, 00:19
Re: SA-MP Color Defines - by killer98p - 19.08.2010, 08:59
Re: SA-MP Color Defines - by vital2k - 19.08.2010, 09:03
Re: SA-MP Color Defines - by Retardedwolf - 19.08.2010, 09:04
Re: SA-MP Color Defines - by vital2k - 19.08.2010, 09:07
Re: SA-MP Color Defines - by playbox12 - 19.08.2010, 09:09
Re: SA-MP Color Defines - by vital2k - 19.08.2010, 09:11
Re: SA-MP Color Defines - by Dark_Kostas - 19.08.2010, 09:47
Re: SA-MP Color Defines - by vital2k - 19.08.2010, 09:54
Re: SA-MP Color Defines - by Dark_Kostas - 19.08.2010, 10:06
Re: SA-MP Color Defines - by vital2k - 19.08.2010, 10:11
Re: SA-MP Color Defines - by Kyosaur - 19.08.2010, 10:14
Re: SA-MP Color Defines - by Dark_Kostas - 19.08.2010, 10:15
Re: SA-MP Color Defines - by vital2k - 19.08.2010, 10:17
Re: SA-MP Color Defines - by MichaelProPlayer - 29.04.2012, 10:07
Re: SA-MP Color Defines - by Vince - 29.04.2012, 11:06

Forum Jump:


Users browsing this thread: 3 Guest(s)