Screenshots of my Javascript Colortable Pattern Generator Program - Code Provided so you can copy and paste... FOR FUN!



Screenshot of the Javascript Table Pattern Generator Background colors of each <TD> is calculated
Screenshot of the Javascript Table Pattern Generator
Background colors of each <TD> is calculated

<html> 

<head> 

<script type = "text/javascript"> 

//this is the javascript code for generating colortables

// reload (F5) 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() *23 ); 

//red color factor- how fast red changes

var gc=1; 

var gcf=Math.floor( Math.random() *24 ); 

var bc=1; 

var bcf=Math.floor( Math.random() *25 ); 

//document.write(rcf, " ", gcf, " ",  bcf);

//display the random numbers selected

for ( i = 0; i < 58; i++ ) 

document.write("<table cellspacing=0 cellpadding=0 border=0 ><tr>"); 

for (j=0;j<107; 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> 

another screenshot... every pattern is different... reload page (F5) to select new random numbers


After the screenprint is in Photoshop...
Polar Coordinates Distort and make it square.


ANOTHER TUTORIAL: Javascript code for My "Shrink in a Box Program"... a Psychobabble Generator... Like talking to a Therapist...  https://gvan42.blogspot.com/2018/04/javascript-code-for-my-shrink-in-box.html

Popular Posts