|
@@ -1780,12 +1780,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ let sourceId = 0;
|
|
|
+
|
|
|
class Source {
|
|
|
|
|
|
constructor( data = null ) {
|
|
|
|
|
|
this.isSource = true;
|
|
|
|
|
|
+ Object.defineProperty( this, 'id', { value: sourceId ++ } );
|
|
|
+
|
|
|
this.uuid = generateUUID();
|
|
|
|
|
|
this.data = data;
|
|
@@ -8842,30 +8846,35 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
this.g = 1;
|
|
|
this.b = 1;
|
|
|
|
|
|
+ return this.set( r, g, b );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ set( r, g, b ) {
|
|
|
+
|
|
|
if ( g === undefined && b === undefined ) {
|
|
|
|
|
|
// r is THREE.Color, hex or string
|
|
|
- return this.set( r );
|
|
|
|
|
|
- }
|
|
|
+ const value = r;
|
|
|
|
|
|
- return this.setRGB( r, g, b );
|
|
|
+ if ( value && value.isColor ) {
|
|
|
|
|
|
- }
|
|
|
+ this.copy( value );
|
|
|
|
|
|
- set( value ) {
|
|
|
+ } else if ( typeof value === 'number' ) {
|
|
|
|
|
|
- if ( value && value.isColor ) {
|
|
|
+ this.setHex( value );
|
|
|
|
|
|
- this.copy( value );
|
|
|
+ } else if ( typeof value === 'string' ) {
|
|
|
|
|
|
- } else if ( typeof value === 'number' ) {
|
|
|
+ this.setStyle( value );
|
|
|
|
|
|
- this.setHex( value );
|
|
|
+ }
|
|
|
|
|
|
- } else if ( typeof value === 'string' ) {
|
|
|
+ } else {
|
|
|
|
|
|
- this.setStyle( value );
|
|
|
+ this.setRGB( r, g, b );
|
|
|
|
|
|
}
|
|
|
|