disjukr / croquis.js

HTML5 drawing tool library

Home Page:https://croquisjs.0xabcdef.com/example/common-brush

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

croquis.js

this library provides Photoshop-like brush features.

it also provides functions such as stabilization of brush strokes.

install

npm install @disjukr/croquis-js
# or
yarn add @disjukr/croquis-js

stroke protocol

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.

license

croquis.js is dual-licensed under Apache 2.0 and MIT terms.

About

HTML5 drawing tool library

https://croquisjs.0xabcdef.com/example/common-brush


Languages

Language:TypeScript 99.9%Language:JavaScript 0.1%