* @function LevelRenderer.Tool.Color.prototype.toName * @description 转换颜色名。 * @param {string} color - 颜色。 * @returns {string} 颜色名
(color)
| 593 | * @returns {string} 颜色名 |
| 594 | */ |
| 595 | toName(color) { |
| 596 | for (var key in this._nameColors) { |
| 597 | if (this.toHex(this._nameColors[key]) === this.toHex(color)) { |
| 598 | return key; |
| 599 | } |
| 600 | } |
| 601 | return null; |
| 602 | } |
| 603 | |
| 604 | /** |
| 605 | * @function LevelRenderer.Tool.Color.prototype.trim |