void init_palette_256(void)
{
const int colorMaxNum = 216;//8bit 下共有216种组合色
unsigned char table_rgb[ colorMaxNum * 3];
int fr, fg, fb;
int index = 0;
for( fr = 0;fr < 256;){
for( fg = 0;fg < 256;){
for( fb = 0;fb < 256;){
table_rgb[ index ] = fr;
table_rgb[ index + 1 ] = fg;
table_rgb[ index + 2 ] = fb;
index += 3;
fb += 51;
}
fg += 51;
}
fr += 51;
}
set_palette(0, colorMaxNum - 1, table_rgb);
return;
}
// 已测试 能正常使用
{
const int colorMaxNum = 216;//8bit 下共有216种组合色
unsigned char table_rgb[ colorMaxNum * 3];
int fr, fg, fb;
int index = 0;
for( fr = 0;fr < 256;){
for( fg = 0;fg < 256;){
for( fb = 0;fb < 256;){
table_rgb[ index ] = fr;
table_rgb[ index + 1 ] = fg;
table_rgb[ index + 2 ] = fb;
index += 3;
fb += 51;
}
fg += 51;
}
fr += 51;
}
set_palette(0, colorMaxNum - 1, table_rgb);
return;
}
// 已测试 能正常使用