MCPcopy
hub / github.com/mrdoob/three.js / sub

Method sub

src/math/Color.js:727–735  ·  view source on GitHub ↗

* Subtracts the RGB values of the given color from the RGB values of this color. * * @param {Color} color - The color to subtract. * @return {Color} A reference to this color.

( color )

Source from the content-addressed store, hash-verified

725 * @return {Color} A reference to this color.
726 */
727 sub( color ) {
728
729 this.r = Math.max( 0, this.r - color.r );
730 this.g = Math.max( 0, this.g - color.g );
731 this.b = Math.max( 0, this.b - color.b );
732
733 return this;
734
735 }
736
737 /**
738 * Multiplies the RGB values of the given color with the RGB values of this color.

Callers 15

Vector2.tests.jsFile · 0.45
Vector3.tests.jsFile · 0.45
Color.tests.jsFile · 0.45
Ray.tests.jsFile · 0.45
Vector4.tests.jsFile · 0.45
constructorMethod · 0.45
onTouchMoveMethod · 0.45
getVertexPositionMethod · 0.45
setFromCameraMethod · 0.45
handleTriangleMethod · 0.45
handleVertexMethod · 0.45

Calls 1

maxMethod · 0.45

Tested by

no test coverage detected