Tint the capture with a color.
Tints an HTML capture with a mix-blend-mode overlay. Opacity 0 leaves it unchanged.
npm install @zumer/snapdom@latest @zumer/snapdom-plugins@latestUsage
import { snapdom } from '@zumer/snapdom';
import { colorTint } from '@zumer/snapdom-plugins/color-tint';
const el = document.querySelector('#target');
const result = await snapdom(el, { plugins: [colorTint({ color: 'royalblue', opacity: 0.4 })] });
const image = await result.toPng();
document.body.append(image);
Options
| Option | Type | Default | Description |
|---|---|---|---|
color | string | 'red' | Any CSS color value |
opacity | number | 1 | Overlay opacity (0–1) |