Skip to content
Apexify.jsDocs
Apexify.js version v5.4.5

Node / Canvas · guide

Background layers (bgLayers)

Current Apexify.js 6.0.0 documentation for Background layers (bgLayers).

apexify.jsRuntime: nodeCURRENTSince 6.0.0

What they are

bgLayers is an array painted after the primary background (colorBg / gradientBg / customBg / videoBg or transparent base), before patternBg and noiseBg.

Order: index 0 = bottom, last index = top.


Allowed type values

typeWhat you provide
colorvalue: CSS color string
gradientvalue: full gradient object
imagesource: path/URL; fit, align
patternsource: image for tiling; repeat
presetPatternpattern: PatternOptions — same procedural type values as patternBg (catalogue)
noiseintensity between 0 and 1

Every layer may include opacity and blendMode (GlobalCompositeOperation).


Example — tint + grain

SOURCEtypescript
typescript
Studio
await painter.createCanvas({  width: 1080,  height: 1080,  colorBg: '#1e1b4b',  bgLayers: [    { type: 'noise', intensity: 0.05, blendMode: 'overlay' },    {      type: 'presetPattern',      pattern: {        type: 'dots',        color: '#c7d2fe',        opacity: 0.15,        size: 8,        spacing: 24,      },      blendMode: 'soft-light',    },  ],});

Validation errors

createCanvas validates each layer:

  • type must be one of the allowed strings.
  • color layers need string value.
  • gradient layers need value.type.
  • image / pattern need non-empty source string.
  • presetPattern needs pattern object with type string.
  • noise intensity must be 0–1 if set.

Next steps