Unlock custom brushes, natural fill effects and intuitive hatching in p5.js
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>p5.brush Test Index</title>
<style>
:root {
--paper: #f3eee2;
--ink: #1e2a35;
--muted: #576574;
--line: #d4c8b8;
--card: rgba(255, 252, 245, 0.84);
--accent-a: #153e5c;
--accent-b: #8f3a2f;
}
* { box-sizing: border-box; }
body {
margin: 0;
min-height: 100vh;
color: var(--ink);
background:
radial-gradient(circle at top left, rgba(21, 62, 92, 0.08), transparent 28%),
radial-gradient(circle at top right, rgba(143, 58, 47, 0.08), transparent 26%),
linear-gradient(180deg, #faf6ee 0%, var(--paper) 100%);
font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
}
main {
width: min(980px, calc(100vw - 28px));
margin: 0 auto;
padding: 24px 0 32px;
display: grid;
justify-items: center;
}
main > * { width: 100%; }
header {
display: grid;
gap: 8px;
margin-bottom: 16px;
justify-items: center;
text-align: center;
}
.eyebrow {
font-family: Menlo, Monaco, "Courier New", monospace;
font-size: 11px;
letter-spacing: 0.18em;
text-transform: uppercase;
color: var(--accent-a);
}
h1 {
margin: 0;
font-size: clamp(28px, 3.6vw, 40px);
line-height: 1;
letter-spacing: -0.04em;
}
.intro {
max-width: 640px;
margin: 0;
color: var(--muted);
font-size: 14px;
line-height: 1.45;
}
.band {
border: 1px solid var(--line);
background: rgba(255, 252, 246, 0.82);
border-radius: 10px;
padding: 14px;
}
.band + .band {
margin-top: 18px;
}
.band-head {
display: grid;
gap: 4px;
margin-bottom: 12px;
text-align: center;
}
.band h2 {
margin: 0;
font-size: 18px;
}
.band p {
margin: 0;
color: var(--muted);
line-height: 1.45;
font-size: 13px;
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
gap: 10px;
}
.card {
display: grid;
gap: 5px;
min-width: 0;
min-height: 0;
padding: 12px;
text-decoration: none;
color: inherit;
border-radius: 8px;
border: 1px solid rgba(48, 41, 30, 0.14);
background: var(--card);
transition: border-color 160ms ease, background 160ms ease;
}
.card:hover {
background: rgba(255, 252, 245, 0.96);
border-color: rgba(21, 62, 92, 0.28);
}
.card h3 {
margin: 0;
font-size: 15px;
line-height: 1.25;
overflow-wrap: anywhere;
}
.card p {
margin: 0;
color: var(--muted);
line-height: 1.4;
font-size: 12px;
overflow-wrap: anywhere;
}
.path,
.meta {
font-family: Menlo, Monaco, "Courier New", monospace;
font-size: 11px;
}
.path {
color: var(--accent-a);
overflow-wrap: anywhere;
word-break: break-word;
}
.meta { color: var(--accent-b); }
@media (max-width: 720px) {
main {
width: min(980px, calc(100vw - 18px));
padding-top: 18px;
}
.band {
padding: 12px;
}
}
</style>
</head>
<body>
<main>
<header>
<div class="eyebrow">p5.brush / test</div>
<h1>Test Index</h1>
<p class="intro">
Manual browser pages for rendering, transform, instance-mode, and regression checks.
</p>
</header>
<section class="band">
<div class="band-head">
<h2>p5 Tests</h2>
<p>Use these pages to visually inspect the p5 build directly in the browser.</p>
</div>
<div class="grid">
<a class="card" href="./p5/visual_suite.html">
<h3>Visual API Suite</h3>
<p>Wide coverage page that exercises most public APIs and logs error-message checks to the console.</p>
<span class="meta">Coverage</span>
<span class="path">test/p5/visual_suite.html</span>
</a>
<a class="card" href="./p5/fill_circle_explorer.html">
<h3>Fill Circle Explorer</h3>
<p>Seeded single-shape page for inspecting watercolor fill bleed, opacity, texture, border, and palette color on a centered circle.</p>
<span class="meta">Explorer</span>
<span class="path">test/p5/fill_circle_explorer.html</span>
</a>
<a class="card" href="./p5/fill_angle_test.html">
<h3>Fill Angle Test</h3>
<p>Same seeded watercolor polygon repeated with different fillBleed() angles.</p>
<span class="meta">Behavior</span>
<span class="path">test/p5/fill_angle_test.html</span>
</a>
<a class="card" href="./p5/wash_test.html">
<h3>Wash Test</h3>
<p>Direct WEBGL wash page that draws five random rect and circle polygons with palette colors at full opacity.</p>
<span class="meta">Coverage</span>
<span class="path">test/p5/wash_test.html</span>
</a>
<a class="card" href="./p5/pastel_hatching_test.html">
<h3>Pastel Hatching Test</h3>
<p>Minimal global-mode sketch with a custom crayon brush and a single centered rectangle for pastel hatching experiments.</p>
<span class="meta">Experiment</span>
<span class="path">test/p5/pastel_hatching_test.html</span>
</a>
<a class="card" href="./p5/angle_mode_test.html">
<h3>Angle Mode Test</h3>
<p>Compares degrees, radians, mixed mode changes, stored hatch angles, low-level Position movement, and custom fields.</p>
<span class="meta">Behavior</span>
<span class="path">test/p5/angle_mode_test.html</span>
</a>
<a class="card" href="./p5/transform_test.html">
<h3>Transform Alignment</h3>
<p>Checks that brush strokes and fills align with native p5 reference geometry under translate, rotate, and scale.</p>
<span class="meta">Geometry</span>
<span class="path">test/p5/transform_test.html</span>
</a>
<a class="card" href="./p5/pushpop_test.html">
<h3>Push / Pop State</h3>
<p>Verifies that p5 push/pop restores stroke, brush, fill, and hatch state correctly.</p>
<span class="meta">State</span>
<span class="path">test/p5/pushpop_test.html</span>
</a>
<a class="card" href="./p5/hatch_test.html">
<h3>Hatch Test</h3>
<p>Exercises hatch angles, spacing, rand/continuous/gradient options, cross-hatching, brush types, shapes, and multi-polygon arrays.</p>
<span class="meta">Coverage</span>
<span class="path">test/p5/hatch_test.html</span>
</a>
<a class="card" href="./p5/hatch_array_regression.html">
<h3>Hatch Array Regression</h3>
<p>Minimal concentric-circle regression for brush.hatchArray() to confirm nested polygon arrays hatch only the annulus.</p>
<span class="meta">Regression</span>
<span class="path">test/p5/hatch_array_regression.html</span>
</a>
<a class="card" href="./p5/field_explorer.html">
<h3>Flow Field Explorer</h3>
<p>Interactive field inspector for comparing built-in fields with adjustable density and line length.</p>
<span class="meta">Explorer</span>
<span class="path">test/p5/field_explorer.html</span>
</a>
<a class="card" href="./p5/offscreen_target_test.html">
<h3>Offscreen Targets</h3>
<p>Checks brush.load() on p5.Graphics and custom-sized main framebuffers, with pixel-count diagnostics.</p>
<span class="meta">Targets</span>
<span class="path">test/p5/offscreen_target_test.html</span>
</a>
<a class="card" href="./p5/instance_mode_test.html">
<h3>Instance Mode</h3>
<p>Checks brush.instance(p) on the instance canvas, an instance p5.Graphics target, and an instance-owned main framebuffer.</p>
<span class="meta">Instances</span>
<span class="path">test/p5/instance_mode_test.html</span>
</a>
<a class="card" href="./p5/multi_instance_async_test.html">
<h3>Async Multi-Instance</h3>
<p>Stress-tests the old multi-instance startup race with many instance-mode sketches and repeated canvas ownership checks.</p>
<span class="meta">Regression</span>
<span class="path">test/p5/multi_instance_async_test.html</span>
</a>
</div>
</section>
<section class="band">
<div class="band-head">
<h2>Standalone Tests</h2>
<p>Use these pages to inspect the standalone build without p5.</p>
</div>
<div class="grid">
<a class="card" href="./standalone/visual_suite.html">
<h3>Standalone Visual API Suite</h3>
<p>Broad standalone coverage page for brushes, fields, primitives, hatch, wash, mass, fill, and custom/image brush types.</p>
<span class="meta">Coverage</span>
<span class="path">test/standalone/visual_suite.html</span>
</a>
<a class="card" href="./standalone/fill_circle_explorer.html">
<h3>Standalone Fill Circle Explorer</h3>
<p>Seeded single-shape page for inspecting watercolor fill bleed, opacity, texture, border, and palette color in the standalone build.</p>
<span class="meta">Explorer</span>
<span class="path">test/standalone/fill_circle_explorer.html</span>
</a>
<a class="card" href="./standalone/fill_angle_test.html">
<h3>Standalone Fill Angle Test</h3>
<p>Same seeded watercolor polygon repeated with different fillBleed() angles in the standalone build.</p>
<span class="meta">Behavior</span>
<span class="path">test/standalone/fill_angle_test.html</span>
</a>
<a class="card" href="./standalone/wash_test.html">
<h3>Standalone Wash Test</h3>
<p>Draws random rect and circle polygons with palette colors at full opacity in the standalone build.</p>
<span class="meta">Coverage</span>
<span class="path">test/standalone/wash_test.html</span>
</a>
<a class="card" href="./standalone/pastel_hatching_test.html">
<h3>Standalone Pastel Hatching</h3>
<p>Custom crayon brush and centered rectangle for pastel hatching experiments in the standalone build.</p>
<span class="meta">Experiment</span>
<span class="path">test/standalone/pastel_hatching_test.html</span>
</a>
<a class="card" href="./standalone/angle_mode_test.html">
<h3>Standalone Angle Mode</h3>
<p>Compares degrees, radians, mixed mode changes, stored hatch angles, and custom fields in the standalone build.</p>
<span class="meta">Behavior</span>
<span class="path">test/standalone/angle_mode_test.html</span>
</a>
<a class="card" href="./standalone/transform_test.html">
<h3>Standalone Transform Alignment</h3>
<p>Native 2D references are overlaid on standalone brush marks to verify translate, rotate, scale, stroke, and fill alignment.</p>
<span class="meta">Geometry</span>
<span class="path">test/standalone/transform_test.html</span>
</a>
<a class="card" href="./standalone/pushpop_test.html">
<h3>Standalone Push / Pop</h3>
<p>Checks that standalone push/pop restores stroke color, weight, brush type, and fill state.</p>
<span class="meta">State</span>
<span class="path">test/standalone/pushpop_test.html</span>
</a>
<a class="card" href="./standalone/hatch_test.html">
<h3>Standalone Hatch Test</h3>
<p>Exercises hatch angles, spacing, rand/continuous/gradient options, cross-hatching, shape variety, and combined hatch settings.</p>
<span class="meta">Coverage</span>
<span class="path">test/standalone/hatch_test.html</span>
</a>
<a class="card" href="./standalone/field_explorer.html">
<h3>Standalone Flow Field Explorer</h3>
<p>Interactive field inspector for comparing built-in fields with adjustable density and line length in the standalone build.</p>
<span class="meta">Explorer</span>
<span class="path">test/standalone/field_explorer.html</span>
</a>
</div>
</section>
</main>
</body>
</html>