colorFilter property

ColorFilter colorFilter

A color filter to apply when a shape is drawn or when a layer is composited.

See ColorFilter for details.

When a shape is being drawn, colorFilter overrides color and shader.

Implementation

ColorFilter get colorFilter {
  if (_objects == null || _objects[_kColorFilterIndex] == null) {
    return null;
  }
  return _objects[_kColorFilterIndex].creator;
}
void colorFilter= (ColorFilter value)

Implementation

set colorFilter(ColorFilter value) {
  final _ColorFilter nativeFilter = value?._toNativeColorFilter();
  if (nativeFilter == null) {
    if (_objects != null) {
      _objects[_kColorFilterIndex] = null;
    }
  } else {
    if (_objects == null) {
      _objects = List<dynamic>(_kObjectCount);
      _objects[_kColorFilterIndex] = nativeFilter;
    } else if (_objects[_kColorFilterIndex]?.creator != value) {
      _objects[_kColorFilterIndex] = nativeFilter;
    }
  }
}