this library provides Photoshop-like brush features.
it also provides functions such as stabilization of brush strokes.
npm install croquis.js
# or
yarn add croquis.js
brush-related functions in croquis.js are working on the stroke protocol.
stroke protocol consists of the down
method and the move
and up
methods of the drawing context.
down
method means that the stylus pen has started drawing a stroke. it returns the drawing context containing the move
and up
methods.
move
means that the stylus pen draws a stroke, and up
means that the stroke ends.
stroke protocol makes it easy to add features such as stabilization without having to modify the drawing code very much.
look at the simple brush example and the pulled string stabilizer example. you can see that the code is not different except for the part injecting the settings and the part drawing the guide.
croquis.js is dual-licensed under Apache 2.0 and MIT terms.