Documentation
    Preparing search index...

    Function registerShapePaints

    • Installs the §58 paint-object tier: after this call, Shape2D accepts LinearGradientPaint, RadialGradientPaint, ConicGradientPaint and PatternPaint in fill/stroke on shapes constructed without a material, and the §79 shape readers restore the same forms from documents. Idempotent; call it once at startup, beside the registerNodeMaterialPipeline() call that lets the backend draw what this lets the author say.

      import { registerShapePaints } from "@fourjs/render";
      import { registerNodeMaterialPipeline } from "@fourjs/render-webgl";

      registerShapePaints();
      registerNodeMaterialPipeline();
      const sun = new Circle({
      radius: 1,
      fill: {
      kind: "radial-gradient",
      center: { x: 0, y: 0 },
      radius: 1,
      stops: [
      { offset: 0, color: [1, 0.9, 0.4, 1] },
      { offset: 1, color: [1, 0.4, 0, 1] },
      ],
      },
      });

      Returns void