One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com
Using 89% of the same design the blog had in 2001.
FOR ENTERTAINMENT PURPOSES ONLY!!!
Back-up your data and, when you bike,
always wear white.
As an Amazon Associate, I earn from qualifying purchases. Affiliate links in green.
What a pain. I've wasted hours trying to take in an index and produce a unique color to go with it. Here, it's to create icons that represent which table, out of over six-thousand, is a particular attribute's origin. It's impossible to come up with 600, much less 6000, easily discernable colors, I think. But this seems to work as well as it's going to without displaying more than one color at a time.
<head> <script> functiondetermineViewRGB_stepped(i){ var intNum =10; var lumStart =80; var lumStep =19;//seemsaboutrighttoensureallcolors //arenoticeablydifferentfromtheirneighborsinthisscale.
var modNum =(i%intNum); var divNum =~~(i/intNum);
var modDivNumBy6 =(divNum%6)+1; var divCntBySteps =~~(i/(lumStep+1));
var int111Iterations =~~((i)/(intNum*6));
var intZero =(int111Iterations * lumStep)%256; var intValue =((modNum * lumStep)+ lumStart)%256;
var strReturn ='rgb('+ intR +','+ intG +','+ intB +')';
return strReturn;
}
functioncreateViewIcon(intAttribViewId){ var strReturn ='<spanclass="circle"style="background:' +determineViewRGB_stepped(intAttribViewId)+';"> </span>';
EDIT: This apparently doesn't work in IE9 unless you're in IE7 mode. That's no fun. I need to go back to the page where I got the CSS code from, as at first it did work for me in IE9, but I'm not sure what compatibility settings I had going on there.
The postings on this site are [usually] my own and do not necessarily reflect the views of any employer, past or present, or other entity. About Our Author