Skip to main content
Version: 3.0.0

Properties

IReplayLayerPatternType

Implementation.

import type { IReplayLayerPatternType } from '@picsart/web-replay-sdk';
ValuesDescription
colorThis type is used for patterns that are colors
gradientThis type is used for patterns that are gradients
imageThis type is used for patterns that are images(textures)

IReplayColorStop

Implementation.

import type { IReplayColorStop } from '@picsart/web-replay-sdk';

This value is used for gradient colors. Each color inside gradient is being presented via colorStop regardless of the gradient type.

PropertyTypeRequiredDescription
valueHEXStringyesThe value of the color
percentagenumberyesNumber range between 0 - 100. This is the percentage of the color as color stop inside the gradient

IReplayLinearGradient

Implementation.

import type { IReplayLinearGradient } from '@picsart/web-replay-sdk';
PropertyTypeRequiredDescription
type'linear'yesThe type of the gradient. The value is always equal to linear
colorsIReplayColorStop[]yesAn array of color stops for the gradient
anglenumberyesThe gradient line's angle of direction. A value of 0 is equivalent to top; increasing values rotate clockwise from there.

The value is expressed in degrees.
Optionally, it may be preceded by a - sign. Positive numbers represent clockwise angles, while negative numbers represent counterclockwise angles.

Any angle can be represented by various equivalent values.
For example, 90 equals -270.

angle90 angle180 angleminus90 angle0

For more details check this link

IReplayRadialGradient

Implementation.

import type { IReplayRadialGradient } from '@picsart/web-replay-sdk';
PropertyTypeRequiredDescription
type'radial'yesThe type of the gradient. The value is always equal to radial
colorsIReplayColorStop[]yesAn array of color stops for the gradient
positionPointyesThe position of the gradient. The values here are in percentage(range 0-100)
size{ width: number; height: number }noDetermines the size of the gradient's ending shape. Values provide an explicit ellipse size.

The width represents the horizontal radius and the height is the vertical radius. If two values are equal the ending shape is a circle.

Values are in percentages and relative to the gradient box's corresponding dimension. Negative values are invalid.
The default values are 100 for both width and height.

For more details check this link

IReplayConicGradient

Implementation.

import type { IReplayConicGradient } from '@picsart/web-replay-sdk';
PropertyTypeRequiredDescription
type'conic'yesThe type of the gradient. The value is always equal to conic
colorsIReplayColorStop[]yesAn array of color stops for the gradient
positionPointyesThe position of the gradient. The values here are in percentage(range 0-100)
anglenumberyesDefines the gradient rotation in clockwise direction. The values is in range from 0 to 360. It is measured in degrees

For more details check this link

IReplayGradient

Implementation.

import type { IReplayGradient } from '@picsart/web-replay-sdk';
type IReplayGradient = IReplayLinearGradient | IReplayRadialGradient | IReplayConicGradient;

IReplayLayerPattern

Implementation.

import type { IReplayLayerPattern } from '@picsart/web-replay-sdk';
PropertyTypeRequiredDescription
typeIReplayLayerPatternTypeyesThe type of the pattern
colorHEXStringnoIs required when the type is equal to color. Note that it will be ignored if the value of type is not color
gradientIReplayGradientnoIs required when the type is equal to gradient. Note that it will be ignored if the value of type is not gradient
textureIReplayResourcenoIs required when the type is equal to image. Note that it will be ignored if the value of type is not image

IReplayLineCap

Implementation.

import type { IReplayLineCap } from '@picsart/web-replay-sdk';

This value is used for stroking

ValuesDescription
buttThe ends of lines are squared off at the endpoints.
roundThe ends of lines are rounded.
squareThe ends of lines are squared off by adding a box with an equal width and half the height of the line's thickness.

For more details check the link

IReplayLineJoin

This value is used for stroking

Implementation.

import type { IReplayLineJoin } from '@picsart/web-replay-sdk';
ValuesDescription
bevelFills an additional triangular area between the common endpoint of connected segments, and the separate outside rectangular corners of each segment.
roundRounds off the corners of a shape by filling an additional sector of disc centered at the common endpoint of connected segments. The radius for these rounded corners is equal to the line width.
miterConnected segments are joined by extending their outside edges to connect at a single point, with the effect of filling an additional lozenge-shaped area.

For more details check the link

IReplayStroke

Implementation.

import type { IReplayStroke } from '@picsart/web-replay-sdk';
info

To remove the stroke from layer you can use null as the value for stroke property

PropertyTypeRequiredDescription
patternIReplayLayerPatternyesThe pattern for stroking
widthnumberyesA non-negative float specifying the width of the stroke as a percentage of the layer's normalized diagonal length.

The normalized diagonal is calculated as (width)2+(height)22\frac{\sqrt{(\text{width})^2 + (\text{height})^2}}{\sqrt{2}}, which standardizes the diagonal relative to the layer’s dimensions.

A value of 0 results in no visible stroke, while larger percentages increase the thickness of the stroke.

For the text width is a percentage from the fontSize.

NOTE: The stroke is applied to the layer's actual size without scaling, and then it is scaled together with the layer.
linecapIReplayLineCapyesThe stroke linecap
linejoinIReplayLineJoinyesThe stroke linejoin

IReplayShadow

Implementation.

import type { IReplayShadow } from '@picsart/web-replay-sdk';
info

To remove the shadow from layer you can use null as the value for shadow property

PropertyTypeRequiredDescription
colorHEXStringyesThe shadow color
blurnumberyesA non-negative float specifying the level of shadow blur, where 0 represents no blur and larger numbers represent increasingly more blur. The value represents the standard deviation in the 2D Gaussian blur algorithm.
offsetPointyesSpecifies the offset distance for shadows along the horizontal (x) and vertical (y) axes. The values are integer numbers:
  • x-axis: Positive values move the shadow to the right, while negative values move it to the left.
  • y-axis: Positive values move the shadow downward, while negative values move it upward.
The offset values are represented as percentages, where 100% corresponds to the full size of the respective side.
For the text the offset is a percentage from the fontSize.

NOTE: When the layer is rotated, the shadow rotates around its own center point, not the layer’s center. This means the light source for the shadow remains fixed relative to the shadow itself, maintaining a consistent direction. As shown in the illustration, the shadow's position relative to the layer does not change even as the layer rotates.

shadow

IReplayLayerBlendMode

Implementation.

import type { IReplayLayerBlendMode } from '@picsart/web-replay-sdk';
type IReplayLayerBlendMode =
| 'source-over'
| 'source-in'
| 'source-out'
| 'source-atop'
| 'destination-over'
| 'destination-in'
| 'destination-out'
| 'destination-atop'
| 'lighter'
| 'copy'
| 'xor'
| 'multiply'
| 'screen'
| 'overlay'
| 'darken'
| 'lighten'
| 'color-dodge'
| 'color-burn'
| 'hard-light'
| 'soft-light'
| 'difference'
| 'exclusion'
| 'hue'
| 'saturation'
| 'color'
| 'luminosity';
ValuesDescription
source-overThis is the default setting and draws new shapes on top of the existing canvas content.
source-inThe new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent.
source-outThe new shape is drawn where it doesn't overlap the existing canvas content.
source-atopThe new shape is only drawn where it overlaps the existing canvas content.
destination-overNew shapes are drawn behind the existing canvas content.
destination-inThe existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent.
destination-outThe existing content is kept where it doesn't overlap the new shape.
destination-atopThe existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content.
lighterWhere both shapes overlap, the color is determined by adding color values.
copyOnly the new shape is shown.
xorShapes are made transparent where both overlap and drawn normal everywhere else.
multiplyThe pixels of the top layer are multiplied with the corresponding pixels of the bottom layer. A darker picture is the result.
screenThe pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply)
overlayA combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter.
darkenRetains the darkest pixels of both layers.
lightenRetains the lightest pixels of both layers.
color-dodgeDivides the bottom layer by the inverted top layer.
color-burnDivides the inverted bottom layer by the top layer, and then inverts the result.
hard-lightLike overlay, a combination of multiply and screen — but instead with the top layer and bottom layer swapped
soft-lightA softer version of hard-light. Pure black or white does not result in pure black or white.
differenceSubtracts the bottom layer from the top layer — or the other way round — to always get a positive value.
exclusionLike difference, but with lower contrast.
huePreserves the luma and chroma of the bottom layer, while adopting the hue of the top layer.
saturationPreserves the luma and hue of the bottom layer, while adopting the chroma of the top layer.
colorPreserves the luma of the bottom layer, while adopting the hue and chroma of the top layer.
luminosityPreserves the hue and chroma of the bottom layer, while adopting the luma of the top layer.

Cross-Platform Mapping

WebAndroid (API 29+)iOS
source-overSRC_OVERNormal
source-inSRC_INSource In
source-outSRC_OUTSource Out
source-atopSRC_ATOPSource Atop
destination-overDST_OVERDestination Over
destination-inDST_INDestination In
destination-outDST_OUTDestination Out
destination-atopDST_ATOPDestination Atop
lighterADDPlus Lighter
multiplyMULTIPLYMultiply
screenSCREENScreen
overlayOVERLAYOverlay
darkenDARKENDarken
lightenLIGHTENLighten
color-dodgeCOLOR_DODGEColor Dodge
color-burnCOLOR_BURNColor Burn
hard-lightHARD_LIGHTHard Light
soft-lightSOFT_LIGHTSoft Light
differenceDIFFERENCEDifference
exclusionEXCLUSIONExclusion
hueHUEHue
saturationSATURATIONSaturation
colorCOLORColor
luminosityLUMINOSITYLuminosity
xorXORXOR

For more information check this link