File: rainbow.js

package info (click to toggle)
gap-gapdoc 1.6.2-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 4,452 kB
  • sloc: xml: 3,491; makefile: 243; sh: 3
file content (60 lines) | stat: -rw-r--r-- 2,782 bytes parent folder | download | duplicates (84)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

function randchar(str) {
  var i = Math.floor(Math.random() * str.length);
  while (i == str.length)
    i = Math.floor(Math.random() * str.length);
  return str[i]; 
}

hexdigits = "0123456789abcdef";

function randlight() {
  return    randchar("cdef")+randchar(hexdigits)+
            randchar("cdef")+randchar(hexdigits)+
            randchar("cdef")+randchar(hexdigits)
}
function randdark() {
  return    randchar("012345789")+randchar(hexdigits)+
            randchar("012345789")+randchar(hexdigits)+
            randchar("102345789")+randchar(hexdigits)
}

document.write('<style type="text/css">\n<!--\n');
document.write('body {\n  color: #'+randdark()+';\n  background: #'+
               randlight()+';\n}\n');
document.write('a:link {\n  color: #'+randdark()+';\n}\n');
document.write('a:visited {\n  color: #'+randdark()+';\n}\n');
document.write('a:active {\n  color: #'+randdark()+';\n}\n');
document.write('a:hover {\n  background-color: #'+randlight()+';\n}\n');
document.write('pre {\n  color: #'+randdark()+';\n}\n');
document.write('tt {\n  color: #'+randdark()+';\n}\n');
document.write('code {\n  color: #'+randdark()+';\n}\n');
document.write('var {\n  color: #'+randdark()+';\n}\n');
document.write('div.func {\n  background-color: #'+randlight()+';\n}\n');
document.write('div.example {\n  background-color: #'+randlight()+';\n}\n');
document.write('div.chlinktop {\n  background-color: #'+randlight()+';\n}\n');
document.write('div.chlinkbot {\n  background-color: #'+randlight()+';\n}\n');
document.write('pre.normal {\n  color: #'+randdark()+';\n}\n');
document.write('code.func {\n  color: #'+randdark()+';\n}\n');
document.write('code.keyw {\n  color: #'+randdark()+';\n}\n');
document.write('code.file {\n  color: #'+randdark()+';\n}\n');
document.write('code.code {\n  color: #'+randdark()+';\n}\n');
document.write('code.i {\n  color: #'+randdark()+';\n}\n');
document.write('strong.button {\n  color: #'+randdark()+';\n}\n');
document.write('span.Heading {\n  color: #'+randdark()+';\n}\n');
document.write('var.Arg {\n  color: #'+randdark()+';\n}\n');
document.write('strong.pkg {\n  color: #'+randdark()+';\n}\n');
document.write('strong.Mark {\n  color: #'+randdark()+';\n}\n');
document.write('b.Ref {\n  color: #'+randdark()+';\n}\n');
document.write('span.Ref {\n  color: #'+randdark()+';\n}\n');
document.write('span.GAPprompt {\n  color: #'+randdark()+';\n}\n');
document.write('span.GAPbrkprompt {\n  color: #'+randdark()+';\n}\n');
document.write('span.GAPinput {\n  color: #'+randdark()+';\n}\n');
document.write('b.Bib_author {\n  color: #'+randdark()+';\n}\n');
document.write('span.Bib_key {\n  color: #'+randdark()+';\n}\n');
document.write('i.Bib_title {\n  color: #'+randdark()+';\n}\n');

document.write('-->\n</style>\n');