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

Method createAxialShading

src/api/pdf.ts:2238–2243  ·  view source on GitHub ↗

* Create an axial (linear) shading with explicit coordinates. * * @param options - Shading options including coords and color stops * @returns PDFShading resource for use with page.registerShading() * * @example * ```typescript * const gradient = pdf.createAxialShading({ *

(options: AxialShadingOptions)

Source from the content-addressed store, hash-verified

2236 * ```
2237 */
2238 createAxialShading(options: AxialShadingOptions): PDFShading {
2239 const dict = PDFShading.createAxialDict(options);
2240 const ref = this.register(dict);
2241
2242 return new PDFShading(ref, "axial");
2243 }
2244
2245 /**
2246 * Create a radial shading with explicit coordinates.

Calls 2

registerMethod · 0.95
createAxialDictMethod · 0.80

Tested by

no test coverage detected