|
Registered User
Join Date: Aug 2003
Location: Wales
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
|
colour selection box
im sorry, i guessed it wouldnt work on a mac, i have found out the hard way that IE for the mac is possibly the most fickle of all the browsers, i assure you it works on a pc.
on the same subject, i wrote this to be used in conjunction with automating the build of style sheets by a non coding user,
a simple selection box with all of the named colours and the majority of hex. handy for quick reference.
<xmp>
function doclr(){
boc = new Array ('AliceBlue','AntiqueWhite','Aqua','Aquamarine','Azure','Beige',
'Bisque','Black','BlanchedAlmond','Blue','BlueViolet','Brown','BurlyWood',
'CadetBlue','Chartreuse','Chocolate','Coral','CornflowerBlue','Cornsilk',
'Crimson','Cyan','DarkBlue','DarkCyan','DarkGoldenRod','DarkGray','DarkGreen',
'DarkKhaki','DarkMagenta','DarkOliveGreen','Darkorange','DarkOrchid','DarkRed',
'DarkSalmon','DarkSeaGreen','DarkSlateBlue','DarkSlateGray','DarkTurquoise',
'DarkViolet','DeepPink','DeepSkyBlue','DimGray','DodgerBlue','FireBrick',
'FloralWhite','ForestGreen','Fuchsia','Gainsboro','GhostWhite','Gold',
'GoldenRod','Gray','Green','GreenYellow','HoneyDew','HotPink','IndianRed',
'Indigo','Ivory','Khaki','Lavender','LavenderBlush','LawnGreen','LemonChiffon',
'LightBlue','LightCoral','LightCyan','LightGoldenRodYellow','LightGrey',
'LightGreen','LightPink','LightSalmon','LightSeaGreen','LightSkyBlue',
'LightSlateGray','LightSteelBlue','LightYellow','Lime','LimeGreen','Linen',
'Magenta','Maroon','MediumAquaMarine','MediumBlue','MediumOrchid',
'MediumPurple','MediumSeaGreen','MediumSlateBlue','MediumSpringGreen',
'MediumTurquoise','MediumVioletRed','MidnightBlue','MintCream','MistyRose',
'Moccasin','NavajoWhite','Navy','OldLace','Olive','OliveDrab','Orange',
'OrangeRed','Orchid','PaleGoldenRod','PaleGreen','PaleTurquoise','PaleVioletRed',
'PapayaWhip','PeachPuff','Peru','Pink','Plum','PowderBlue','Purple','Red',
'RosyBrown','RoyalBlue','SaddleBrown','Salmon','SandyBrown','SeaGreen','SeaShell',
'Sienna','Silver','SkyBlue','SlateBlue','SlateGray','Snow','SpringGreen',
'SteelBlue','Tan','Teal','Thistle','Tomato','Turquoise','Violet','Wheat',
'White','WhiteSmoke','Yellow','YellowGreen');
clr=new Array('00','22','44','66','88','aa','cc','ee','ff');out = '<select>';
for(i=0;i<clr.length;i++){for(j=0;j<clr.length;j++){for(k=0;k < clr.length;k++){
out+='<option style="background-color:#'+clr[i]+clr[j]+clr[k]+';color:#'+clr[7-i]
out+=clr[7-j]+clr[7-k]+'">#'+clr[i]+clr[j]+clr[k];}}}for (i=0;i<boc.length;i++)
{out+='<option style="background-color:'+boc[i]+';color:black">'+boc[i]}
out+='</select>';return out}
document.write(doclr())
</xmp>
Last edited by stunix; 08-19-2003 at 03:38 PM..
|