updateColors method

void updateColors(
  1. Float32List colors, {
  2. int? dirtyStart,
  3. int? dirtyCount,
})

Replaces every vertex color, keeping the vertex count unchanged.

Pass dirtyStart/dirtyCount to upload only a contiguous span; see updatePositions.

Implementation

void updateColors(Float32List colors, {int? dirtyStart, int? dirtyCount}) {
  _ensureUpdatable('updateColors');
  _checkAttributeLength('colors', colors.length, 4);
  _cpuColors = Float32List.fromList(colors);
  _writeStream(
    3,
    _colorRing,
    _cpuColors,
    dirtyStart: dirtyStart,
    dirtyCount: dirtyCount,
  );
}