Browse Source

Add target to getClearColor

Garrett Johnson 4 years ago
parent
commit
380067c434
1 changed files with 10 additions and 2 deletions
  1. 10 2
      src/renderers/WebGLRenderer.js

+ 10 - 2
src/renderers/WebGLRenderer.js

@@ -532,9 +532,17 @@ function WebGLRenderer( parameters ) {
 
 
 	// Clearing
 	// Clearing
 
 
-	this.getClearColor = function () {
+	this.getClearColor = function ( target ) {
 
 
-		return background.getClearColor();
+		if ( target === undefined ) {
+
+			console.warn( 'WebGLRenderer: .getClearColor() now requires a Color as an argument' );
+
+			target = new Color();
+
+		}
+
+		return target.copy( background.getClearColor() );
 
 
 	};
 	};