Skip to main content

Brush Configuration

Brush config controls the stamp used for each rendered point.

Configuration playground

Change color, size, spacing, flow, opacity, roundness-related behavior, and eraser mode to see how brush config affects each stamp.

Loading demo…
interface BrushBasicConfig {
size: number;
opacity: number;
flow: number;
color: string;
angle: number;
roundness: number;
spacing: number;
eraser: boolean;
rotation?: RotationConfig;
}

BrushConfig is the partial version accepted by constructors and loadConfig.

Defaults

{
size: 20,
opacity: 1,
flow: 1,
color: "#000000",
angle: 0,
roundness: 1,
spacing: 0.12,
eraser: false,
}

Fields

FieldDescription
sizeBase stamp size in pixels. Pressure also scales size.
opacityStroke opacity from 0 to 1.
flowPaint buildup from 0 to 1. Pressure also scales flow.
colorCSS color used to fill ellipse stamps or recolor image stamps.
angleBase stamp angle as a fraction of one turn, from 0 to 1.
roundnessEllipse/image width ratio from 0 to 1.
spacingDistance between stamps as a multiplier of brush size.
eraserWhen true, the brush erases content instead of painting it.
rotationOptional stamp rotation behavior.

opacity, flow, and roundness are clamped to 0..1 while rendering. Pressure is also clamped to 0..1; it scales both stamp size and flow.

Flow And Dense Spacing

opacity is a stroke-level ceiling. flow is the rate at which paint builds up through the stamps that make up the stroke.

Since 0.8.7, Fuderu normalizes flow against the active brush size and spacing. This prevents very dense stamp overlap from making low-flow strokes immediately flatten into solid color. Modules still receive the pressure-adjusted flow value in onChangeConfig; the brush renderer applies the spacing-aware per-stamp alpha when the point is queued for drawing.

Rotation

rotation?: {
mode?: "fixed" | "flow" | "random";
offset?: number;
jitter?: number;
smoothing?: number;
};
  • fixed: uses rotation.offset when a rotation config is present. Omit rotation to use the brush's angle field.
  • flow: follows the direction of the stroke.
  • random: varies rotation between stamps.
  • offset: adds an angle offset in radians.
  • jitter: adds random rotation variation in radians.
  • smoothing: smooths flow-based direction changes.