From: rsesek Date: Thu, 15 Mar 2007 00:01:41 +0000 (+0000) Subject: In RGB triads, don't force the parentheses to be there; just allow three comma-separa... X-Git-Tag: 2.1~1 X-Git-Url: https://src.bluestatic.org/?a=commitdiff_plain;h=940b8790551204508e4cfcc72d0e08c053382a67;p=rgbconverter.git In RGB triads, don't force the parentheses to be there; just allow three comma-separated integers git-svn-id: svn://depot/macosx/RGBConverter/trunk@622 ad1dcce9-c9fe-0310-b82b-83ea1733dbb0 --- diff --git a/RGB Converter.wdgt/Widget.js b/RGB Converter.wdgt/Widget.js index 3319f34..471f84b 100644 --- a/RGB Converter.wdgt/Widget.js +++ b/RGB Converter.wdgt/Widget.js @@ -40,7 +40,7 @@ function rgbwatcher(colour) field = document.getElementById(colour + "inputf"); // handle RGB triads - if (triad = field.value.match(/(rgb)?\(([0-9]{1,3}),\s?([0-9]{1,3}),\s?([0-9]{1,3})\)/)) + if (triad = field.value.match(/(rgb)?\(?([0-9]{1,3}),\s?([0-9]{1,3}),\s?([0-9]{1,3})\)?/)) { document.getElementById("redinputf").value = triad[2]; document.getElementById("greeninputf").value = triad[3];