Fading Colors
#4

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};
Reply


Messages In This Thread
Fading Colors - by Glad2BeHere - 23.03.2013, 00:26
Re: Fading Colors - by HurtLocker - 23.03.2013, 00:35
Re: Fading Colors - by faff - 23.03.2013, 01:39
Re: Fading Colors - by Babul - 23.03.2013, 01:40
Re: Fading Colors - by Glad2BeHere - 23.03.2013, 02:02
Re: Fading Colors - by Babul - 23.03.2013, 16:22

Forum Jump:


Users browsing this thread: 1 Guest(s)