Colors List

From SA-MP Wiki

Revision as of 13:51, 24 August 2009; view current revision
←Older revision | Newer revision→
Jump to: navigation, search

There's a lot of colours in SA-MP. Colours (with a u) for vehicles, map pointers, and GameText/Textdraw. Here are some stuff you might like to know.


Contents

GameText colors

For GameText colors you can use special tags to set the following text to a specific color.

~r~    red
~g~    green
~b~    blue
~w~    white
~y~    yellow
~p~    purple
~l~    black
~n~    new line
~h~    lighter color


Example

~w~Hello this is ~b~blue ~w~and this is ~r~red
Hello this is blue and this is red

Chat text and player color

A chattext or player color looks like this 0xRRGGBBAA The RR is the red part of the color, the GG the green and the BB the blue. AA is the alphavalue. If you use FF there it will be displayed without transparency and if you put it to 00 it will be invisible.

For the Hex code for these colours, go to the Hex colours page.


Alpha values (transparency)


Convert string to value with pawn

Since the colors are just numbers you have to convert them sometimes from a string "RRGGBBAA" to its number.

// Author: DracoBlue, http://forum.sa-mp.com/index.php?topic=638.msg8635#msg8635
HexToInt(string[]){
   if (string[0]==0) return 0;
   new i;
   new cur=1;
   new res=0;
   for (i=strlen(string);i>0;i--) {
     if (string[i-1]<58) res=res+cur*(string[i-1]-48); else res=res+cur*(string[i-1]-65+10)
     cur=cur*16;
   }
   return res;
 }

Use HexToInt("RRGGBBAA") and you'll get a usable number as result for SetPlayerColor.


Color choosers


Car colors

These are the color IDs that can be used for cars:

Image:Carcolors.jpg

You can find the colors they used in single player for each car on the Original Car Colors page.

Other Car Colors

Warning: These might not sync properly and/or cause clients to crash.

Colour ID Description
130 Very pale pink
132 Pale pistachio
142 Electric blue
144, 145, 181, 182 Turquoise blue
146, 183 Fluorescent pink
147, 184 Sky fluorescent blue
148, 185 Purple
149, 186 Other purple
150, 165 Fuschia
151, 166 Fluorescent red
152, 167 Bind wine color
153, 168, 180 Dark brown
154, 169 Night blue
155, 170 Average red
156, 171 Very dark purple
157, 172 Dark purple
158 King blue
159 Dark pink
160 Other dark pink
161, 176 Lively red
173 Dark fuschia
174 Less dark fuschia
175 Even less dark fuschia
182 Very very bright green
183 Bright Pink
236 Dark green
237, 238, 247, 248, 249, 250, 251 A little less dark green
239, 240, 241, 242, 245, 246 Very dark green
243, 244 Very very dark green (almost black)
252 Brilliant green
Personal tools