R>t1=15;clr-idx=t1;
display-status();return;}
store-user(){
vga-user[clr-idx][0]=red-vol;
vga-user[clr-idx][1]=grn-vol;
vga-user[clr-idx][2]=blu-vol;
return;}
print-user(){
row=16;col=15;
set-cursor(row,col);
printf(“RGB value:”);
set-cursor(row+1,col);
printf(“Index:”);
for(t1=0;t1<16;t1++) printf(“%2d,”,t1);
set-cursor(row+2,col);
printf(“Red: ”);
for(t1=0;t1<16;t1++) printf(“%2d,”,vga-user[t1][0]);
set-cursor(row+3,col);
printf(“Green:”);
for(t1=0;t1<16;t1++) printf(“%2d,”,vga-user[t1][1]);
set-cursor(row+4,col);
printf(“Blue:”);
for(t1=0;t1<16;t1++) printf(“%2d,”,vga-user[t1][2]);
return;}
change-idx(){
set-index();display-status();
setfillstyle(SOLID-FILL,clr-idx);
bar(sx,sy,sx+wsx,sy+wsy);
return;}
change-rgb(){
adjust-color();display-status();
write-rgb(clr-idx,red-vol,grn-vol,blu-vol);
store-user();
return;}
reset-pattern(){
display-status();
setfillstyle(SOLID-FILL,clr-idx);
bar(x1,y1,x1+x2,y1+y2);
return:}
set-cursor(x,y){
regs.h.ah=0x02,regs.h.bh=0;
regs.h.dh=x,regs.h.dl=y;
int86(0x10,®s,®s);
return;}