SA-MP Forums Archive
Color Variables - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Color Variables (/showthread.php?tid=109645)



Color Variables - `Robo - 21.11.2009

When I do for example
Код:
SendClientMessage(playerid, COLOR_RED, "Message Here.");
It says COLOR_RED is an undefined variable. It does it for COLOR_YELLOW and like any color. What's the variable for COLOR?


Re: Color Variables - yom - 21.11.2009

You have to create them yourself, there are many, many colors, and defining all of them with a name is just impossible..

A color is an hexadecimal value made of 4 channels: red, green, blue, and alpha (opacity), each of these chanels have a value from 0 to 255 (00 to FF in hexadecimal notation).

0xRRGGBBAA

So for a true red color, it is:

0xFF0000FF

If you want to give a name to that color, do:
pawn Код:
#define COLOR_RED 0xFF0000FF
If you can't be bothered of creating them yourself, get a color picker, there are tons.


Re: Color Variables - Naruto4 - 21.11.2009

#define [hex color code]

Код:
//-------------------------------
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_SYSTEM 0xEFEFF7AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xCD000000
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIGHTGREEN 0x9ACD32AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_YELLOW2 0xF5DEB3AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_DBLUE 0x2641FEAA