setColors method

AxesHelper setColors(
  1. Color xAxisColor,
  2. Color yAxisColor,
  3. Color zAxisColor
)

Sets the axes colors to xAxisColor, yAxisColor, zAxisColor.

Implementation

AxesHelper setColors(Color xAxisColor, Color yAxisColor, Color zAxisColor) {
  final color = Color(1, 1, 1);
  final array = geometry!.attributes["color"].array;

  color.setFrom(xAxisColor);
  color.copyIntoArray(array, 0);
  color.copyIntoArray(array, 3);

  color.setFrom(yAxisColor);
  color.copyIntoArray(array, 6);
  color.copyIntoArray(array, 9);

  color.setFrom(zAxisColor);
  color.copyIntoArray(array, 12);
  color.copyIntoArray(array, 15);

  geometry!.attributes["color"].needsUpdate = true;

  return this;
}