Skip to main content

Mask Filters

Mask filters are effects that manipulate the geometry and alpha channel of graphical objects.

BlurMask

Creates a blur mask filter.

NameTypeDescription
blurnumberStandard deviation of the Gaussian blur. Must be > 0.
style?BlurStyleCan be normal, solid, outer, or inner (default is normal).
respectCTM?booleanif true the blur's sigma is modified by the CTM (default is false).

Example

tsx
import {Canvas, Fill, Circle, BlurMask, vec} from "@shopify/react-native-skia";
 
const MaskFilterDemo = () => {
return (
<Canvas style={{ flex: 1}}>
<Circle c={vec(128)} r={128} color="lightblue">
<BlurMask blur={20} style="normal" />
</Circle>
</Canvas>
);
};
tsx
import {Canvas, Fill, Circle, BlurMask, vec} from "@shopify/react-native-skia";
 
const MaskFilterDemo = () => {
return (
<Canvas style={{ flex: 1}}>
<Circle c={vec(128)} r={128} color="lightblue">
<BlurMask blur={20} style="normal" />
</Circle>
</Canvas>
);
};
StyleResult
normalNormalinnerInner
solidSolidouterOuter