@artifact-kit/deckkit-pro
v0.1.2
Published
Commercial DeckKit plugin bundle.
Maintainers
Readme
@artifact-kit/deckkit-pro
Commercial DeckKit plugin bundle.
Usage
import DeckKit from '@artifact-kit/deckkit'
import deckkitPro from '@artifact-kit/deckkit-pro'
const deck = new DeckKit()
deck.use(deckkitPro())
const slide = deck.addSlide()
slide.addShape(deck.ShapeType.rect, {
x: 1,
y: 1,
w: 5,
h: 2,
fill: {
type: 'gradient',
angle: 90,
stops: [
{ position: 0, color: 'FF5A5F' },
{ position: 1, color: '2D9CDB' },
],
},
})SVG to PNG
import { renderSvgToPng, writeSvgToPng } from '@artifact-kit/deckkit-pro/svg-to-png'
const svg = '<svg xmlns="http://www.w3.org/2000/svg" width="120" height="80">...</svg>'
const png = await renderSvgToPng(svg, {
width: 240,
height: 160,
})
await writeSvgToPng(svg, 'output.png')CLI:
node dist/svg-to-png-cli.js '<svg xmlns="http://www.w3.org/2000/svg" width="120" height="80">...</svg>' -o output.png
node dist/svg-to-png-cli.js input.svg -o output.png --width 240 --height 160