Fish and the Automated Art Generator Program Pattern Generator Javascript Table

Fish patterned using the Javascript Colortable Program



<html> 
<head> 
<script type = "text/javascript"> 
// colortable - reload page for a different pattern
// copy and paste all code into notepad...
// save the file with a name.html (ending with dot html)
// change dropdown box from text to all files... save it.
// open file with a browser to see table displayed
// open file with notepad to modify code
// PrtScn and paste into Photoshop
var rc=1; 
//red color from 0 to 255
var rcf=Math.floor( Math.random() *33 ); 
//red color factor- how fast red changes
var gc=1; 
var gcf=Math.floor( Math.random() *34 ); 
var bc=1; 
var bcf=Math.floor( Math.random() *35 ); 
//document.write(rcf, " ", gcf, " ",  bcf);
//display the random numbers selected
for ( i = 0; i < 76; i++ ) 
document.write("<table cellspacing=0 cellpadding=0 border=0 ><tr>"); 
for (j=0;j<157; j++)
//counters that go up then start again at the bottom
//or count downwards and loop around to the top...
rc=rc-rcf; 
if(rc<0) rc=rc+255;
if(rc>255) rc=rc-255; 
// make sure colors are withing valid range
gc=gc-gcf; 
if(gc<0) gc=gc+255;
if(gc>255) gc=gc-255; 
bc=bc-bcf; 
if(bc<0) bc=bc+255;
if(bc>255) bc=bc-255;
document.write("<td height=10 width=10 style=background-color:rgb("+rc+","+gc+","+bc+")></td>"); 
//make sure the above command is all on one line
//beware of wordwrap bugs
document.write("</tr></table> "); 
</script> 
</head> 
<body> 
</body> 
</html> 

Popular Posts