inkbrush
TypeScript icon, indicating that this package has built-in type declarations

1.2.5 • Public • Published

inkbrush

A NPM package for generating traditional inkbrush style SVG paths.

Installation

npm i inkbrush

Usage

Simply call the exported function with your parameters. It returns an SVG path. Either write it to file inside an SVG or use it in a frontend environment.

import { generateInkbrush } from 'inkbrush'

const svgInkbrushPath = generateInkbrush({
    viewbox,
    points: [
      { x: 253.685, y: 98.026 },
      { x: 496.162, y: 269.186 },
      { x: 321.248, y: 430.587 }
    ],
    strokeWidths: [{
      breakpoint: 0,
      strokeWidth: 1
    }, {
      breakpoint: 0.5,
      strokeWidth: 10
    }, {
      breakpoint: 1,
      strokeWidth: 1
    }],
    end: {
      numSpikes: 10,
      maxSpikeSize: 1,
      minSpikeSize: 1
    },
    bend: 0.5
  })

Readme

Keywords

Package Sidebar

Install

npm i inkbrush

Weekly Downloads

5

Version

1.2.5

License

ISC

Unpacked Size

33.9 kB

Total Files

16

Last publish

Collaborators

  • riverli