* @function LevelRenderer.Tool.Color.prototype.reverse * @description 颜色翻转。[255-r,255-g,255-b,1-a] * @param {string} color - 颜色。 * @returns {string} 翻转颜色
(color)
| 675 | * @returns {string} 翻转颜色 |
| 676 | */ |
| 677 | reverse(color) { |
| 678 | if (!this.isCalculableColor(color)) { |
| 679 | return color; |
| 680 | } |
| 681 | var data = this.getData(this.toRGBA(color)); |
| 682 | data = this.map(data, |
| 683 | function (c) { |
| 684 | return 255 - c; |
| 685 | } |
| 686 | ); |
| 687 | return this.toColor(data, 'rgb'); |
| 688 | } |
| 689 | |
| 690 | /** |
| 691 | * @function LevelRenderer.Tool.Color.prototype.mix |
no test coverage detected