Skip to content

Gradient Flow API

GradientFlow

Extends Effect.

Factory Function

typescript
createGradientFlow(config?: GradientFlowConfig): Effect<GradientFlowConfig>

Methods

See Effect for the full method reference.


GradientFlowConfig

typescript
interface GradientFlowConfig {
    readonly speed?: number;
    readonly scale?: number;
    readonly colors?: string[];
    readonly blobs?: number;
    readonly resolution?: number;
}
PropertyTypeDefaultDescription
speednumber0.5Drift speed of the color blobs.
scalenumber1Scales all sizes proportionally.
colorsstring[]Colors used for the gradient blobs.
blobsnumber5Number of gradient blobs.
resolutionnumber6Pixel step size for rendering.

GradientBlob

typescript
interface GradientBlob {
    readonly x: number;
    readonly y: number;
    readonly vx: number;
    readonly vy: number;
    readonly radius: number;
    readonly color: string;
}
PropertyTypeDescription
xnumberX coordinate of the blob center.
ynumberY coordinate of the blob center.
vxnumberHorizontal velocity.
vynumberVertical velocity.
radiusnumberInfluence radius of the blob.
colorstringColor of the blob.