23.03.2013, 01:40
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:
for 2 to 6 colors accordingly. btw, you may wabt to write/combine the color values as hexadecimal:
...so to make a transition red>white, leave the red channel at 0xff, and increase green+blue - here with 6 colors:
...and now white>blue:
so the whole array of colors could be initialized as:
Код:
0,255 0,127,255 0,85,170,255 0,63,127,191,255 0,51,102,153,204,255
Код:
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
Код:
0xff0000 0xff3333 0xff6666 0xff9999 0xffcccc 0xffffff
Код:
0xffffff 0xccccff 0x9999ff 0x6666ff 0x3333ff 0x0000ff
pawn Код:
new RedWhiteBlue[]={0xff0000,0xff3333,0xff6666,0xff9999,0xffcccc,0xffffff,0xffffff,0xccccff,0x9999ff,0x6666ff,0x3333ff,0x0000ff};