Displaying 256 different colors

 


//Make use of more than 15 colors with the help of this code.
/**************************************************************/
/*Programmed by : Kunal S Deshmukh*****************************/
/*For Bugs Free feel to contact********************************/
/*Website : www.sourcecode.scriptmania.com*****************************/
/*Email : sourcecodes@rediffmail.com**************************/
/**************************************************************/
#include<graphics.h>
#include<conio.h>
#include<stdio.h>
#include <stdlib.h> //for itoa()
//////////////////////
int huge mode(void)
{return(4);}
/////////////////////
void main()
{
int gd=DETECT,gm=0;
initgraph(&gd,&gm,"");
settextstyle(TRIPLEX_FONT,HORIZ_DIR,4);
setcolor(250);
char str[5];
for(int i=20;i<220;i++){
setfillstyle(1,i);
bar(0,0,1022,765);
outtextxy(25,15,"Color Number is : ");
itoa(i,str,10);
outtextxy(315,15,str);
getch();
}
outtextxy(150,150,"Kunal S Deshmukh");
getch();
closegraph();
}

 

 

 

@All  Rights reserved.Sourcecode ltd.2004-2005