2006-01-27 10:55:41 -05:00
|
|
|
<html>
|
2021-02-24 05:23:34 -05:00
|
|
|
<head>
|
|
|
|
<title>
|
|
|
|
-| 16 colors |-
|
|
|
|
</title>
|
2006-01-27 10:55:41 -05:00
|
|
|
<script type="text/javascript">
|
2021-02-24 05:23:34 -05:00
|
|
|
document.writeln('<html><head><title>-| 16 colors |-</title></head><pre>');
|
|
|
|
var colors=[
|
|
|
|
"white",
|
|
|
|
"maroon",
|
|
|
|
"green",
|
|
|
|
"yellow",
|
|
|
|
"blue",
|
|
|
|
"magenta",
|
|
|
|
"cyan",
|
|
|
|
"white",
|
|
|
|
"grey",
|
|
|
|
"red",
|
|
|
|
"lime",
|
|
|
|
"olive",
|
|
|
|
"teal",
|
|
|
|
"purple",
|
|
|
|
"fuchsia",
|
|
|
|
"aqua",
|
|
|
|
];
|
|
|
|
|
|
|
|
document.write('<table>');
|
|
|
|
colors.forEach(printstr);
|
|
|
|
document.write('</table>');
|
|
|
|
document.writeln('<br>');
|
|
|
|
colors.forEach(printstrln);
|
|
|
|
|
|
|
|
function lpad_str(str) {
|
|
|
|
if (str.length<=9) { str=(str+" ").slice(-9); }
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
function lpad(number) {
|
|
|
|
if (number<=999) { number = ("00"+number).slice(-3); }
|
|
|
|
return number;
|
|
|
|
}
|
|
|
|
function printstr(item,index) {
|
|
|
|
if ((index)%4==0) { document.writeln("<tr>"); }
|
|
|
|
document.write('<td>');
|
|
|
|
document.write('<font color="'+item+'">'+lpad_str(item) +'</font> ');
|
|
|
|
document.write('<td>');
|
|
|
|
if ((index+1)%4==0) { document.writeln("</tr>"); }
|
|
|
|
}
|
|
|
|
function printstrln(item,index) {
|
|
|
|
document.writeln('<font color="'+item+'">'+lpad(index)+' This is '+item+'</font>');
|
|
|
|
}
|
|
|
|
document.writeln('');
|
|
|
|
document.writeln('<font color="yellow">This is true : '+true+'</font>');
|
|
|
|
document.writeln('<font color="red">and this is false: '+false+'</font>');
|
|
|
|
document.writeln('<font color="yellow">',"That's it as ... ","1+1=",2,'</font>');
|
|
|
|
document.writeln('</pre></body></html>');
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
2006-01-27 10:55:41 -05:00
|
|
|
</body>
|
|
|
|
</html>
|