Fading Colors -
Glad2BeHere - 23.03.2013
Is There a way to get a color code 4 3 like Red White Blue...... and the color code fades

so likeeee its red and then the color white fades in to the blue..... u know

......
Re: Fading Colors -
HurtLocker - 23.03.2013
Reading your post I think you want a smooth, gradual transition from color1 to color2. Well, I tried to make transition from white to red but in the end I get an undescribeable
constant mix of all colors, don't try this at home:
pawn Код:
#define COLOR_LIGHTPINK 0xFFB6C1FF
#define COLOR_HOTPINK 0xFF69B4FF
#define COLOR_CORAL 0xFF7F50AA
#define COLOR_TOMATO 0xFF6347AA
#define COLOR_RED 0xFF0000FF
public OnPlayerDeath(playerid, killerid, reason)
{
FadePlayerScreen(playerid, 0xFFFFFFCC, 6, 192);
FadePlayerScreen(playerid, 0xFFB6C1FF, 6, 192);
FadePlayerScreen(playerid, 0xFF69B4FF, 6, 192);
FadePlayerScreen(playerid, 0xFF7F50AA, 6, 192);
FadePlayerScreen(playerid, 0xFF0000FF, 6, 192);
}
Re: Fading Colors -
faff - 23.03.2013
Hmm.. Something like this?
pawn Код:
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
SendNearbyMessage(playerid, 3.0, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
Re: Fading Colors -
Babul - 23.03.2013
colors range from 0 upto 255. those 256 different color tones (per channel) can be split into neat fragments by dividing them by 2, 3, 4, or 5. a transition from 0 to 255, split into 3 steps, or 4 colors (starting at 00=bblack), can be done by incremental inserting values:
Код:
0,255
0,127,255
0,85,170,255
0,63,127,191,255
0,51,102,153,204,255
for 2 to 6 colors accordingly. btw, you may wabt to write/combine the color values as hexadecimal:
Код:
0x 00,ff
0x 00,7f,ff
0x 00,55,aa,ff
0x 00,3f,7f,bf,ff
0x 00,33,66,99,cc,ff
...so to make a transition red>white, leave the red channel at 0xff, and increase green+blue - here with 6 colors:
Код:
0xff0000
0xff3333
0xff6666
0xff9999
0xffcccc
0xffffff
...and now white>blue:
Код:
0xffffff
0xccccff
0x9999ff
0x6666ff
0x3333ff
0x0000ff
so the whole array of colors could be initialized as:
pawn Код:
new RedWhiteBlue[]={0xff0000,0xff3333,0xff6666,0xff9999,0xffcccc,0xffffff,0xffffff,0xccccff,0x9999ff,0x6666ff,0x3333ff,0x0000ff};
Re: Fading Colors -
Glad2BeHere - 23.03.2013
pawn Код:
SendClientMessage(playerid, RedWhiteBlue[1], "hi");
That gives me green

alone.... i wonder if i should strcat it or something

any advice ?
Re: Fading Colors -
Babul - 23.03.2013
oops, i forgot to mention that you need to add the alpha values ><
long story short: add a 00 to each color value, like 0xff3333 becomes 0xff333300.
the color array from above again:
pawn Код:
new RedWhiteBlue[]={0xff000000,0xff333300,0xff666600,0xff999900,0xffcccc00,0xffffff00,0xffffff00,0xccccff00,0x9999ff00,0x6666ff00,0x3333ff00,0x0000ff00};
the format is RRGGBBAA, the added 2 digits "00" left-shift the value, so the color channels are ok now ^^