diff --git a/src/math/Color.js b/src/math/Color.js index e0ccd573204f346620204771ec8836ad4c69afe3..5647be783dacbcef75685b84b508a6fc778080c6 100644 --- a/src/math/Color.js +++ b/src/math/Color.js @@ -96,9 +96,9 @@ THREE.Color.prototype = { // rgb(255,0,0) - if ( /^rgb\((\d+),(\d+),(\d+)\)$/i.test( style ) ) { + if ( /^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.test( style ) ) { - var color = /^rgb\((\d+),(\d+),(\d+)\)$/i.exec( style ); + var color = /^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.exec( style ); this.r = Math.min( 255, parseInt( color[ 1 ], 10 ) ) / 255; this.g = Math.min( 255, parseInt( color[ 2 ], 10 ) ) / 255; @@ -110,9 +110,9 @@ THREE.Color.prototype = { // rgb(100%,0%,0%) - if ( /^rgb\((\d+)\%,(\d+)\%,(\d+)\%\)$/i.test( style ) ) { + if ( /^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.test( style ) ) { - var color = /^rgb\((\d+)\%,(\d+)\%,(\d+)\%\)$/i.exec( style ); + var color = /^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.exec( style ); this.r = Math.min( 100, parseInt( color[ 1 ], 10 ) ) / 100; this.g = Math.min( 100, parseInt( color[ 2 ], 10 ) ) / 100;