Fixed weird bug (update_swatch() would update black on the first time of entering...
authorrsesek <rsesek@ad1dcce9-c9fe-0310-b82b-83ea1733dbb0>
Sun, 21 Aug 2005 06:28:06 +0000 (06:28 +0000)
committerrsesek <rsesek@ad1dcce9-c9fe-0310-b82b-83ea1733dbb0>
Sun, 21 Aug 2005 06:28:06 +0000 (06:28 +0000)
git-svn-id: svn://depot/macosx/trunk@16 ad1dcce9-c9fe-0310-b82b-83ea1733dbb0

RGB_Converter/RGB_Converter.wdgt/Widget.js

index 78159625b2c600469aeb6214bbe26d7396ea9566..a8ee17a40461302c45d7857291f03a21b6239e9a 100644 (file)
@@ -124,7 +124,7 @@ function update_rgb()
 // update the colour swatch
 function update_swatch()
 {
-       document.getElementById("swatch").style.backgroundColor = "#" + fields['hex'];
+       document.getElementById("swatch").style.backgroundColor = "rgb(" + fields['red'] + ", " + fields['green'] + ", " + fields['blue'] + ")";
 }
 
 // ###################################################################