--- trunk/colormatch.js 2004/10/02 23:25:50 2
+++ trunk/colormatch.js 2004/10/02 23:39:42 3
@@ -3,23 +3,23 @@
function sample_go()
{
- document.getElementById('sample').style.backgroundColor = document.getElementById('col7').value;
- document.getElementById('sampleh1').style.backgroundColor = document.getElementById('col0').value;
- document.getElementById('sampleh1').style.color = document.getElementById('col2').value;
- document.getElementById('sampleh1').style.borderColor = document.getElementById('col6').value;
- document.getElementById('sampleh2').style.backgroundColor = document.getElementById('col3').value;
- document.getElementById('sampleh2').style.color = document.getElementById('col5').value;
- document.getElementById('sampleh2').style.borderColor = document.getElementById('col6').value;
- document.getElementById('samplep').style.backgroundColor = document.getElementById('col7').value;
- document.getElementById('samplep').style.color = document.getElementById('col8').value;
- document.getElementById('samplep').style.borderColor = document.getElementById('col6').value;
- document.getElementById('samplelink').style.color = document.getElementById('col1').value;
- document.getElementById('samplehover').style.color = document.getElementById('col4').value;
+ element_id('sample').style.backgroundColor = document.getElementById('col7').value;
+ element_id('sampleh1').style.backgroundColor = document.getElementById('col0').value;
+ element_id('sampleh1').style.color = document.getElementById('col2').value;
+ element_id('sampleh1').style.borderColor = document.getElementById('col6').value;
+ element_id('sampleh2').style.backgroundColor = document.getElementById('col3').value;
+ element_id('sampleh2').style.color = document.getElementById('col5').value;
+ element_id('sampleh2').style.borderColor = document.getElementById('col6').value;
+ element_id('samplep').style.backgroundColor = document.getElementById('col7').value;
+ element_id('samplep').style.color = document.getElementById('col8').value;
+ element_id('samplep').style.borderColor = document.getElementById('col6').value;
+ element_id('samplelink').style.color = document.getElementById('col1').value;
+ element_id('samplehover').style.color = document.getElementById('col4').value;
}
function htmlgo()
{
- k=document.getElementById('html').value;
+ k=element_id('html').value;
j = k.replace('#','');
red = j.substr(0,2);
gre = j.substr(2,2);
@@ -32,7 +32,7 @@
function c2r(d)
{
- k=document.getElementById(d).style.backgroundColor;
+ k=element_id(d).style.backgroundColor;
j=(k.substr(4,k.indexOf(")")-4)).split(",");
r.setValue(j[0]);
g.setValue(j[1]);
@@ -40,7 +40,7 @@
}
function load_theme()
{
- sel = document.getElementById("coltheme");
+ sel = element_id("coltheme");
var d = sel.options[sel.selectedIndex].value;
j=d.split(",");
r.setValue(j[0]);
@@ -50,14 +50,14 @@
function ud(x,c)
{
- document.getElementById("sw"+x).style.backgroundColor="rgb("+c.r+","+c.g+","+c.b+")";
- document.getElementById("hc"+x).innerHTML="#"+rg2html(c) + "
R: "+c.r+"
G: "+c.g+"
B: "+c.b;
- document.getElementById("col"+x).value="#"+rg2html(c)
+ element_id("sw"+x).style.backgroundColor="rgb("+c.r+","+c.g+","+c.b+")";
+ element_id("hc"+x).innerHTML="#"+rg2html(c) + "
R: "+c.r+"
G: "+c.g+"
B: "+c.b;
+ element_id("col"+x).value="#"+rg2html(c)
if(x == 0)
{
- document.getElementById("bookmark").value="http://color.twysted.net/?color="+rg2html(c);
- document.getElementById("light").style.backgroundColor="rgb("+inc(c.r)+","+inc(c.g)+","+inc(c.b)+")";
- document.getElementById("dark").style.backgroundColor="rgb("+dec(c.r)+","+dec(c.g)+","+dec(c.b)+")";
+ element_id("bookmark").value="http://color.twysted.net/?color="+rg2html(c);
+ element_id("light").style.backgroundColor="rgb("+inc(c.r)+","+inc(c.g)+","+inc(c.b)+")";
+ element_id("dark").style.backgroundColor="rgb("+dec(c.r)+","+dec(c.g)+","+dec(c.b)+")";
}
}
function rg2html(z)