|
@@ -7937,27 +7937,27 @@ class Color {
|
|
|
case 'rgb':
|
|
|
case 'rgba':
|
|
|
|
|
|
- if ( color = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) {
|
|
|
+ if ( color = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) {
|
|
|
|
|
|
// rgb(255,0,0) rgba(255,0,0,0.5)
|
|
|
this.r = Math.min( 255, parseInt( color[ 1 ], 10 ) ) / 255;
|
|
|
this.g = Math.min( 255, parseInt( color[ 2 ], 10 ) ) / 255;
|
|
|
this.b = Math.min( 255, parseInt( color[ 3 ], 10 ) ) / 255;
|
|
|
|
|
|
- handleAlpha( color[ 5 ] );
|
|
|
+ handleAlpha( color[ 4 ] );
|
|
|
|
|
|
return this;
|
|
|
|
|
|
}
|
|
|
|
|
|
- if ( color = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) {
|
|
|
+ if ( color = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) {
|
|
|
|
|
|
// rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)
|
|
|
this.r = Math.min( 100, parseInt( color[ 1 ], 10 ) ) / 100;
|
|
|
this.g = Math.min( 100, parseInt( color[ 2 ], 10 ) ) / 100;
|
|
|
this.b = Math.min( 100, parseInt( color[ 3 ], 10 ) ) / 100;
|
|
|
|
|
|
- handleAlpha( color[ 5 ] );
|
|
|
+ handleAlpha( color[ 4 ] );
|
|
|
|
|
|
return this;
|
|
|
|
|
@@ -7968,14 +7968,14 @@ class Color {
|
|
|
case 'hsl':
|
|
|
case 'hsla':
|
|
|
|
|
|
- if ( color = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) {
|
|
|
+ if ( color = /^(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) {
|
|
|
|
|
|
// hsl(120,50%,50%) hsla(120,50%,50%,0.5)
|
|
|
const h = parseFloat( color[ 1 ] ) / 360;
|
|
|
const s = parseInt( color[ 2 ], 10 ) / 100;
|
|
|
const l = parseInt( color[ 3 ], 10 ) / 100;
|
|
|
|
|
|
- handleAlpha( color[ 5 ] );
|
|
|
+ handleAlpha( color[ 4 ] );
|
|
|
|
|
|
return this.setHSL( h, s, l );
|
|
|
|
|
@@ -7985,7 +7985,7 @@ class Color {
|
|
|
|
|
|
}
|
|
|
|
|
|
- } else if ( m = /^\#([A-Fa-f0-9]+)$/.exec( style ) ) {
|
|
|
+ } else if ( m = /^\#([A-Fa-f\d]+)$/.exec( style ) ) {
|
|
|
|
|
|
// hex color
|
|
|
|
|
@@ -16557,7 +16557,7 @@ StructuredUniform.prototype.setValue = function ( gl, value, textures ) {
|
|
|
|
|
|
// Parser - builds up the property tree from the path strings
|
|
|
|
|
|
-const RePathPart = /([\w\d_]+)(\])?(\[|\.)?/g;
|
|
|
+const RePathPart = /(\w+)(\])?(\[|\.)?/g;
|
|
|
|
|
|
// extracts
|
|
|
// - the identifier (member name or array index)
|
|
@@ -19787,12 +19787,12 @@ function WebGLState( gl, extensions, capabilities ) {
|
|
|
|
|
|
if ( glVersion.indexOf( 'WebGL' ) !== - 1 ) {
|
|
|
|
|
|
- version = parseFloat( /^WebGL\ ([0-9])/.exec( glVersion )[ 1 ] );
|
|
|
+ version = parseFloat( /^WebGL (\d)/.exec( glVersion )[ 1 ] );
|
|
|
lineWidthAvailable = ( version >= 1.0 );
|
|
|
|
|
|
} else if ( glVersion.indexOf( 'OpenGL ES' ) !== - 1 ) {
|
|
|
|
|
|
- version = parseFloat( /^OpenGL\ ES\ ([0-9])/.exec( glVersion )[ 1 ] );
|
|
|
+ version = parseFloat( /^OpenGL ES (\d)/.exec( glVersion )[ 1 ] );
|
|
|
lineWidthAvailable = ( version >= 2.0 );
|
|
|
|
|
|
}
|