<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title>DOM CSS: Typical Usage RGBColor Test</title>
 </head>
 <body>
  <p>The next line of text should be green and should read "color:
  rgb(0%, 100%, 0%)".</p>
  <div id="foo" style="color: green"/>
  <script type="text/javascript">
   var CSS_PERCENTAGE = 2;
   var colorValue = document.getElementById("foo").style.getPropertyCSSValue("color").getRGBColorValue();
   var red = colorValue.red.getFloatValue(CSS_PERCENTAGE);
   var green = colorValue.green.getFloatValue(CSS_PERCENTAGE);
   var blue = colorValue.blue.getFloatValue(CSS_PERCENTAGE);
   document.getElementById("foo").appendChild(document.createTextNode("color: rgb("+red+"%, "+green+"%, "+blue+"%)"));
  </script>
 </body>
</html>