fb
fabric-brush
npm i fabric-brush
fb

fabric-brush

Crayon is a canvas brush based on an awesome framework Fabric.js

by Tennison Chan

0.0.1 (see all)License:MITTypeScript:Not Found
npm i fabric-brush
Readme

Fabric Brush - Canvas Brushes on Fabric.js

Fabric Brush is a collection of brushes built on an awesome canvas framework Fabric.js

Quickstart

Demo

crayon-brush ink-brush marker-brush spray-brush

Examples of use

Set the crayon brush as the free drawing brush

<script src="bower_components/fabric.js"></script>
<script src="bower_components/dist/fabric-brush.js"></script>

<canvas id="c"></canvas>
var canvas = new fabric.Canvas('c');

// Crayon Brush
canvas.freeDrawingBrush = new fabric.CrayonBrush(canvas, {
  width: 70,
  opacity: 0.6,
  color: "#ff0000"
});

// Ink Brush
// canvas.freeDrawingBrush = new fabric.InkBrush(canvas);

// Marker Brush
// canvas.freeDrawingBrush = new fabric.MarkerBrush(canvas);

// Spray Brush
// canvas.freeDrawingBrush = new fabric.SprayBrush(canvas);

Change color of the brush into red

canvas.freeDrawingBrush.changeColor("#ff0000");

Change opacity of the brush into 0.6

canvas.freeDrawingBrush.changeOpacity(0.6);

Downloads/wk

6

GitHub Stars

227

LAST COMMIT

6yrs ago

MAINTAINERS

1

CONTRIBUTORS

1

OPEN ISSUES

7

OPEN PRs

0
VersionTagPublished
0.0.1
latest
3yrs ago
No alternatives found
No tutorials found
Add a tutorial

Rate & Review

100
No reviews found
Be the first to rate