"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var THREE = require("three"); var ColorPalette = [ [255, 0, 0, 255], //[255, 255, 255, 255],//----- 0 - ByBlock - White [255, 0, 0, 255], // [255, 0, 0, 255], //----- 1 - Red [255, 255, 0, 255], [0, 255, 0, 255], [0, 255, 255, 255], [0, 0, 255, 255], [255, 0, 255, 255], ]; //颜色材质,对于二维图像来说可能有用,应该不对三维对象使用该材质 var ColorMaterial = /** @class */ (function () { function ColorMaterial() { } ColorMaterial.GetLineMaterial = function (index) { if (this.m_LineMaterialMap.has(index)) return this.m_LineMaterialMap.get(index); var mat = new THREE.LineBasicMaterial({ color: this.GetColor(index) }); this.m_LineMaterialMap.set(index, mat); return mat; }; ColorMaterial.GetColor = function (index) { var rgb = ColorPalette[index]; if (rgb) return new THREE.Color(rgb[0] / 255, rgb[1] / 255, rgb[2] / 255); }; ColorMaterial.m_LineMaterialMap = new Map(); return ColorMaterial; }()); exports.ColorMaterial = ColorMaterial; //# sourceMappingURL=ColorPalette.js.map