Skip to content

Commit f2552d8

Browse files
Mugen87abernier
authored andcommitted
Color: Do not use prototype for r/g/b properties. (mrdoob#24061)
1 parent e33ac95 commit f2552d8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/math/Color.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ class Color {
5656

5757
constructor( r, g, b ) {
5858

59+
this.r = 1;
60+
this.g = 1;
61+
this.b = 1;
62+
5963
if ( g === undefined && b === undefined ) {
6064

6165
// r is THREE.Color, hex or string
@@ -607,8 +611,5 @@ class Color {
607611
Color.NAMES = _colorKeywords;
608612

609613
Color.prototype.isColor = true;
610-
Color.prototype.r = 1;
611-
Color.prototype.g = 1;
612-
Color.prototype.b = 1;
613614

614615
export { Color, SRGBToLinear };

0 commit comments

Comments
 (0)