/[colormatch]/trunk/colormatch.js
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/colormatch.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2 by dpavlin, Sat Oct 2 23:25:50 2004 UTC revision 3 by dpavlin, Sat Oct 2 23:39:42 2004 UTC
# Line 3  var rg=new Object(); Line 3  var rg=new Object();
3    
4  function sample_go()  function sample_go()
5  {  {
6          document.getElementById('sample').style.backgroundColor = document.getElementById('col7').value;          element_id('sample').style.backgroundColor = document.getElementById('col7').value;
7          document.getElementById('sampleh1').style.backgroundColor = document.getElementById('col0').value;          element_id('sampleh1').style.backgroundColor = document.getElementById('col0').value;
8          document.getElementById('sampleh1').style.color = document.getElementById('col2').value;          element_id('sampleh1').style.color = document.getElementById('col2').value;
9          document.getElementById('sampleh1').style.borderColor = document.getElementById('col6').value;          element_id('sampleh1').style.borderColor = document.getElementById('col6').value;
10          document.getElementById('sampleh2').style.backgroundColor = document.getElementById('col3').value;          element_id('sampleh2').style.backgroundColor = document.getElementById('col3').value;
11          document.getElementById('sampleh2').style.color = document.getElementById('col5').value;          element_id('sampleh2').style.color = document.getElementById('col5').value;
12          document.getElementById('sampleh2').style.borderColor = document.getElementById('col6').value;          element_id('sampleh2').style.borderColor = document.getElementById('col6').value;
13          document.getElementById('samplep').style.backgroundColor = document.getElementById('col7').value;          element_id('samplep').style.backgroundColor = document.getElementById('col7').value;
14          document.getElementById('samplep').style.color = document.getElementById('col8').value;          element_id('samplep').style.color = document.getElementById('col8').value;
15          document.getElementById('samplep').style.borderColor = document.getElementById('col6').value;          element_id('samplep').style.borderColor = document.getElementById('col6').value;
16          document.getElementById('samplelink').style.color = document.getElementById('col1').value;          element_id('samplelink').style.color = document.getElementById('col1').value;
17          document.getElementById('samplehover').style.color = document.getElementById('col4').value;          element_id('samplehover').style.color = document.getElementById('col4').value;
18    
19  }  }
20  function htmlgo()  function htmlgo()
21   {   {
22          k=document.getElementById('html').value;          k=element_id('html').value;
23          j = k.replace('#','');          j = k.replace('#','');
24          red = j.substr(0,2);          red = j.substr(0,2);
25          gre = j.substr(2,2);          gre = j.substr(2,2);
# Line 32  function htmlgo() Line 32  function htmlgo()
32    
33  function c2r(d)  function c2r(d)
34  {  {
35          k=document.getElementById(d).style.backgroundColor;          k=element_id(d).style.backgroundColor;
36          j=(k.substr(4,k.indexOf(")")-4)).split(",");          j=(k.substr(4,k.indexOf(")")-4)).split(",");
37          r.setValue(j[0]);          r.setValue(j[0]);
38          g.setValue(j[1]);          g.setValue(j[1]);
# Line 40  function c2r(d) Line 40  function c2r(d)
40  }  }
41  function load_theme()  function load_theme()
42  {  {
43          sel = document.getElementById("coltheme");          sel = element_id("coltheme");
44          var d = sel.options[sel.selectedIndex].value;          var d = sel.options[sel.selectedIndex].value;
45          j=d.split(",");          j=d.split(",");
46          r.setValue(j[0]);          r.setValue(j[0]);
# Line 50  function load_theme() Line 50  function load_theme()
50    
51  function ud(x,c)  function ud(x,c)
52  {  {
53          document.getElementById("sw"+x).style.backgroundColor="rgb("+c.r+","+c.g+","+c.b+")";          element_id("sw"+x).style.backgroundColor="rgb("+c.r+","+c.g+","+c.b+")";
54          document.getElementById("hc"+x).innerHTML="#"+rg2html(c) + "<br />R: "+c.r+"<br />G: "+c.g+"<br />B: "+c.b;          element_id("hc"+x).innerHTML="#"+rg2html(c) + "<br />R: "+c.r+"<br />G: "+c.g+"<br />B: "+c.b;
55          document.getElementById("col"+x).value="#"+rg2html(c)          element_id("col"+x).value="#"+rg2html(c)
56          if(x == 0)          if(x == 0)
57                  {                  {
58                  document.getElementById("bookmark").value="http://color.twysted.net/?color="+rg2html(c);                  element_id("bookmark").value="http://color.twysted.net/?color="+rg2html(c);
59                  document.getElementById("light").style.backgroundColor="rgb("+inc(c.r)+","+inc(c.g)+","+inc(c.b)+")";                  element_id("light").style.backgroundColor="rgb("+inc(c.r)+","+inc(c.g)+","+inc(c.b)+")";
60                  document.getElementById("dark").style.backgroundColor="rgb("+dec(c.r)+","+dec(c.g)+","+dec(c.b)+")";                  element_id("dark").style.backgroundColor="rgb("+dec(c.r)+","+dec(c.g)+","+dec(c.b)+")";
61          }          }
62  }  }
63  function rg2html(z)  function rg2html(z)

Legend:
Removed from v.2  
changed lines
  Added in v.3

  ViewVC Help
Powered by ViewVC 1.1.26