MCPcopy Create free account
hub / github.com/LibPDF-js/core / createShadingPattern

Method createShadingPattern

src/api/pdf.ts:2421–2426  ·  view source on GitHub ↗

* Create a shading pattern from a shading (gradient). * * Shading patterns wrap a gradient so it can be used as a fill or stroke color, * just like tiling patterns. This is the recommended way to use gradients with * PathBuilder and high-level drawing methods. * * @param options -

(options: ShadingPatternOptions)

Source from the content-addressed store, hash-verified

2419 * ```
2420 */
2421 createShadingPattern(options: ShadingPatternOptions): PDFShadingPattern {
2422 const dict = PDFShadingPattern.createDict(options);
2423 const ref = this.register(dict);
2424
2425 return new PDFShadingPattern(ref, options.shading);
2426 }
2427
2428 // ─────────────────────────────────────────────────────────────────────────────
2429 // Low-Level Drawing API - Extended Graphics State

Calls 2

registerMethod · 0.95
createDictMethod · 0.45

Tested by

no test coverage detected