* 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 )
| 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. |
no test coverage detected