Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/riverliway/inkbrush
A NPM package for generating traditional inkbrush style SVG paths
https://github.com/riverliway/inkbrush
Last synced: 29 days ago
JSON representation
A NPM package for generating traditional inkbrush style SVG paths
- Host: GitHub
- URL: https://github.com/riverliway/inkbrush
- Owner: riverliway
- Created: 2024-03-07T20:53:16.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-09T19:21:17.000Z (10 months ago)
- Last Synced: 2024-10-30T06:58:02.485Z (2 months ago)
- Language: TypeScript
- Size: 498 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.
```typescript
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
})
```