updateColor method

dynamic updateColor(
  1. dynamic uniform
)

Implementation

updateColor(uniform) {
  var updated = false;

  var a = this.buffer;
  var c = uniform.getValue();
  var offset = uniform.offset;

  if (a[offset + 0] != c.r || a[offset + 1] != c.g || a[offset + 2] != c.b) {
    a[offset + 0] = c.r;
    a[offset + 1] = c.g;
    a[offset + 2] = c.b;

    updated = true;
  }

  return updated;
}