RGBを十進数に変換。 もっと単純にできないものだろうか?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<title>TEST</title>
<style type="text/css">
body,#a {background-color:#000 }
#a { color:#000; }
</style>
<body>
<div><a href="http://okwave.jp/qa5034462.html"  id="a">テキストリンクの色を徐々に濃く</a></div> 
<script type="text/javascript">

window.onload = function () { ChangeColor('a', '#000', '#fff', 100, 30); }

function ChangeColor (eid, col1, col2, step, time) {

  var s = document.getElementById(eid).style; //if (! s) return;
  var c1 = getEachColor(col1); //if (! c1[0]) return;
  var c2 = getEachColor(col2); //if (! c2[0]) return;
  var c3 = [(c2[0] - c1[0]) / step, (c2[1] - c1[1]) / step, (c2[2] - c1[2]) / step];
  var i = 0;

  return function _() {
    s.color = 'rgb(' + (c1[0]|0) + ',' + (c1[1]|0) + ',' + (c1[2]|0) + ')';
    c1[0] += c3[0], c1[1] += c3[1], c1[2] += c3[2];
    i++ < step && setTimeout (_, time);
  }();
}

function getEachColor(RGB) {
  if (/^#[0-9A-F]{3}$/i.test(RGB)) {
    return eval(RGB.replace(/^#(\w)(\w)(\w)$/i, '[0x$1$1,0x$2$2,0x$3$3]'));
  } else if (/^#[0-9A-F]{6}$/i.test(RGB)) {
    return eval(RGB.replace(/^#(\w\w)(\w\w)(\w\w)/i, '[0x$1,0x$2,0x$3]'));
  } else if (/^rgb\(\d+,\s\d+,\s\d+\)$/i.test(RGB)) {
    return eval(RGB.replace(/^rgb\((\d+),\s(\d+),\s(\d+)\)$/i, '[$1,$2,$3]'));
  }
  return null;
}
</script>