apply method

  1. @override
void apply(
  1. ActorComponent? component,
  2. double mix
)
override

Implementation

@override
void apply(ActorComponent? component, double mix) {
  ColorStroke node = component as ColorStroke;
  Float32List wr = node.color;
  int len = wr.length;
  if (mix == 1.0) {
    for (int i = 0; i < len; i++) {
      wr[i] = _value[i];
    }
  } else {
    double mixi = 1.0 - mix;
    for (int i = 0; i < len; i++) {
      wr[i] = wr[i] * mixi + _value[i] * mix;
    }
  }
  node.markPaintDirty();
}