Unlock custom brushes, natural fill effects and intuitive hatching in p5.js
Better standard brushes
Alejandro1b0732d23218
diff --git a/p5.brush.js b/p5.brush.jsindex 4718d72..ad0a635 100644--- a/p5.brush.js+++ b/p5.brush.js@@ -2307,12 +2307,12 @@// For example, the "pen" brush has a weight of 0.35, a vibration of 0.12, etc.// The "marker2" brush has a custom tip defined by a function that draws rectangles.["pen", { weight: 0.35, vibration: 0.12, definition: 0.5, quality: 8, opacity: 200, spacing: 0.3, pressure: {curve: [0.15,0.2], min_max: [1.3,1]} }],- ["rotring", { weight: 0.2, vibration: 0.05, definition: 1, quality: 300, opacity: 250, spacing: 0.15, pressure: {curve: [0.05,0.2], min_max: [1.2,0.95]} }],+ ["rotring", { weight: 0.2, vibration: 0.05, definition: 1, quality: 3, opacity: 250, spacing: 0.15, pressure: {curve: [0.05,0.2], min_max: [1.2,0.95]} }],["2B", { weight: 0.4, vibration: 0.45, definition: 0.1, quality: 9, opacity: 160, spacing: 0.2, pressure: {curve: [0.15,0.2], min_max: [1.2,1]} }],["HB", { weight: 0.3, vibration: 0.5, definition: 0.4, quality: 4, opacity: 180, spacing: 0.25, pressure: {curve: [0.15,0.2], min_max: [1.2,0.9]} }],["2H", { weight: 0.2, vibration: 0.4, definition: 0.3, quality: 2, opacity: 150, spacing: 0.2, pressure: {curve: [0.15,0.2], min_max: [1.2,0.9]} }],["cpencil", { weight: 0.4, vibration: 0.6, definition: 0.8, quality: 7, opacity: 120, spacing: 0.15, pressure: {curve: [0.15,0.2], min_max: [0.95,1.15]} }],- ["charcoal", { weight: 0.45, vibration: 2, definition: 0.7, quality: 300, opacity: 110, spacing: 0.07, pressure: {curve: [0.15,0.2], min_max: [1.3,0.95]} }],+ ["charcoal", { weight: 0.5, vibration: 2, definition: 0.8, quality: 300, opacity: 130, spacing: 0.06, pressure: {curve: [0.15,0.2], min_max: [1.3,0.95]} }],["hatch_brush", { weight: 0.2, vibration: 0.4, definition: 0.3, quality: 2, opacity: 150, spacing: 0.15, pressure: {curve: [0.5,0.7], min_max: [1,1.5]} }],["spray", { type: "spray", weight: 0.3, vibration: 12, definition: 15, quality: 40, opacity: 120, spacing: 0.65, pressure: {curve: [0,0.1], min_max: [0.15,1.2]} }],["marker", { type: "marker", weight: 2.5, vibration: 0.08, opacity: 30, spacing: 0.4, pressure: {curve: [0.35,0.25], min_max: [1.35,1]}}],diff --git a/sketch.js b/sketch.jsindex 5a1f8d4..1e51f8a 100644--- a/sketch.js+++ b/sketch.js@@ -82,6 +82,8 @@ function setup () {// STANDARD PALETTE TEST+ /*+let i = 0for (let b of brush.box()) {brush.set(b,random(palette),1)@@ -90,7 +92,7 @@ function setup () {}- /*+// Set your brush name, color, and weight. There are 9 standard brushes to select from.// Select colors with HEX codes, arrays of [r,g,b] or names@@ -212,7 +214,7 @@ function setup () {brush.set("2B","#9c2128",1)-+ */let num_cols = 5let num_rows = 3@@ -233,7 +235,7 @@ function setup () {}}- */+}