Text Colors...
3 posters
Elite Square :: Blockland :: Coding Help
Page 1 of 1
Text Colors...
I see alot of ppl still using \c[NUMBER] and it annoys me pretty much. You know you can have richer colors using color codes?..
Sure, \c[NUMBER] is shorter, but you can make way much more thing with color code and I think it's important that you know how it's made.
Soz, the code goes like this: <color:CODE>
The code is basicly made of 6 parameters;
<color:FF0000> would make the text RED
<color:00FF00> would make the text GREEN
<color:0000FF> would make the text BLUE
Since you know this, you can make combos!
<color:FF00FF> would make the text PURPLE(; VIOLET)
<color:00FFFF> would make the text TEAL (; CYAN)
<color:FFFF00> would make the text YELLOW
Well, you can use your mind like a baws.. Or use this : ColorPicker
To use it in scripting, it goes like this (Exemples) :
Also, there's no trouble replacing the color code by a variable if you use it alot..
Hope you'll think about using it more often ;)
Also, if you don't understand the code I wrote above, take a look to: Torque-Script Guide
Sure, \c[NUMBER] is shorter, but you can make way much more thing with color code and I think it's important that you know how it's made.
Soz, the code goes like this: <color:CODE>
The code is basicly made of 6 parameters;
<color:FF0000> would make the text RED
<color:00FF00> would make the text GREEN
<color:0000FF> would make the text BLUE
Since you know this, you can make combos!
<color:FF00FF> would make the text PURPLE(; VIOLET)
<color:00FFFF> would make the text TEAL (; CYAN)
<color:FFFF00> would make the text YELLOW
Well, you can use your mind like a baws.. Or use this : ColorPicker
To use it in scripting, it goes like this (Exemples) :
- Code:
announce("<color:FF0000 Hello World!");
- Code:
$VariableWithCoolName="Hello World!"; announce("<color:0000FF>"@$VariableWithCoolName);
- Code:
$Var1 = "Hello"; $Var2 = "World"; $Var3 = "!"; announce("<color:FF0000>"@$Var1 SPC "<color:00FF00>"@$var2@"<color:0000FF>"@$var3);
Also, there's no trouble replacing the color code by a variable if you use it alot..
- Code:
$SuperColor = "<color:FF00EE>"; announce($SuperColor@"Hello World!");
Hope you'll think about using it more often ;)
Also, if you don't understand the code I wrote above, take a look to: Torque-Script Guide
Innocent- Blocklandian
- Posts : 17
Join date : 2012-12-31
Age : 27
Location : Montreal
Re: Text Colors...
I think you should mention what the codes actually are, because if you don't know what they are then you shouldn't be using them, you should be using the \c codes.
What they ARE is really 3 sets of 2 hexadecimal characters, one for red, green, and blue.
That's why 555555 is gray, and AAAAAA is a darker gray, 000000 is white, and FFFFFF is black.
What they ARE is really 3 sets of 2 hexadecimal characters, one for red, green, and blue.
That's why 555555 is gray, and AAAAAA is a darker gray, 000000 is white, and FFFFFF is black.
Re: Text Colors...
Ipquarx wrote:I think you should mention what the codes actually are, because if you don't know what they are then you shouldn't be using them, you should be using the \c codes.
What they ARE is really 3 sets of 2 hexadecimal characters, one for red, green, and blue.
That's why 555555 is gray, and AAAAAA is a darker gray, 000000 is white, and FFFFFF is black.
OK-
Its like the RGB colors
"AmountRed AmountGreen AmountBlue"
But you count up to 255 with this "Base16" counting, like
The numbers are
0 1 2 3 4 5 6 7 8 9 A B C D E F
so no red would be 00
and 2 green would be 02
and maybe you want 15 blue 0F
Its like counting up to 16 and then carrying a one:
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B ....
Since it goes up to 255 (which happens to be 16*16 - 1) (-1 because of zero) it is like counting up to 100 (10*10)
so if you wanted alot of red, make FF (which is 255)
if you wanted about 1/2 green, you would want about 127 which is 7F
ALSO
if you are too lazy to count in base16, just search "# in hex"
and it will read "0x##" which, the ## is hex for the number you searched
Is that good?
Last edited by Meshiest on Tue Jan 08, 2013 7:45 pm; edited 2 times in total
Re: Text Colors...
Perfectly good ^^ :P Didn't want to tell all the things about the hex field but.. okay xD
Innocent- Blocklandian
- Posts : 17
Join date : 2012-12-31
Age : 27
Location : Montreal
Re: Text Colors...
I was bored so I made an "AutoHex"
Basically, this makes it so you can use getHexadecimal(NUMBER);
It returns the hexdecimal of number
- Code:
function getHexadecimal(%x)
{
while (%x>0)
{
%remainder = %x % 16;
switch(%remainder)
{
case 0 : %result = %remainder@%result;
case 1 : %result = %remainder@%result;
case 2 : %result = %remainder@%result;
case 3 : %result = %remainder@%result;
case 4 : %result = %remainder@%result;
case 5 : %result = %remainder@%result;
case 6 : %result = %remainder@%result;
case 7 : %result = %remainder@%result;
case 8 : %result = %remainder@%result;
case 9 : %result = %remainder@%result;
case 10 : %result = "A"@%result;
case 11 : %result = "B"@%result;
case 12 : %result = "C"@%result;
case 13 : %result = "D"@%result;
case 14 : %result = "E"@%result;
case 15 : %result = "F"@%result;
}
%x = %x/16;
}
return %result;
}
Basically, this makes it so you can use getHexadecimal(NUMBER);
It returns the hexdecimal of number
Elite Square :: Blockland :: Coding Help
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|