* Create a linear gradient using angle and length (CSS-style). * * @param options - Gradient options including angle, length, and color stops * @returns PDFShading resource for use with page.registerShading() * * @example * ```typescript * const gradient = pdf.createLinearGradie
(options: LinearGradientOptions)
| 2287 | * ``` |
| 2288 | */ |
| 2289 | createLinearGradient(options: LinearGradientOptions): PDFShading { |
| 2290 | const coords = PDFShading.calculateAxialCoords(options.angle, options.length); |
| 2291 | const dict = PDFShading.createAxialDict({ coords, stops: options.stops }); |
| 2292 | const ref = this.register(dict); |
| 2293 | |
| 2294 | return new PDFShading(ref, "axial"); |
| 2295 | } |
| 2296 | |
| 2297 | // ───────────────────────────────────────────────────────────────────────────── |
| 2298 | // Low-Level Drawing API - Patterns |
no test coverage detected