|
@@ -153,6 +153,18 @@ THREE.Color.prototype = {
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ setContextStyle: function ( contextStyle ) {
|
|
|
|
+
|
|
|
|
+ var color = /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/i.exec(contextStyle);
|
|
|
|
+
|
|
|
|
+ this.r = parseInt(color[1], 10) / 255;
|
|
|
|
+ this.g = parseInt(color[2], 10) / 255;
|
|
|
|
+ this.b = parseInt(color[3], 10) / 255;
|
|
|
|
+
|
|
|
|
+ return this;
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
lerpSelf: function ( color, alpha ) {
|
|
lerpSelf: function ( color, alpha ) {
|
|
|
|
|
|
this.r += ( color.r - this.r ) * alpha;
|
|
this.r += ( color.r - this.r ) * alpha;
|