In math.color.ts - CheckColors4 doesn’t apply math, the way the comment suggests? 4 in comment vs 3 in code.
/
* Check the content of a given array and convert it to an array containing RGBA data
* If the original array was already containing count * 4 values then it is returned directly
* @param colors defines the array to check
* @param count defines the number of RGBA data to expect
* @returns an array containing count * 4 values (RGBA)
*/
public static CheckColors4(colors: number[], count: number): number[] {
// Check if color3 was used
if (colors.length === count * 3) {
var colors4 = [];
for (var index = 0; index < colors.length; index += 3) {
var newIndex = (index / 3) * 4;
colors4[newIndex] = colors[index];
colors4[newIndex + 1] = colors[index + 1];
colors4[newIndex + 2] = colors[index + 2];
colors4[newIndex + 3] = 1.0;
}
return colors4;
}
return colors;