pixi.js
Version:
<p align="center"> <a href="https://pixijs.com" target="_blank" rel="noopener noreferrer"> <img height="150" src="https://files.pixijs.download/branding/pixijs-logo-transparent-dark.svg?v=1" alt="PixiJS logo"> </a> </p> <br/> <p align="center">
1 lines • 27.6 kB
Source Map (JSON)
{"version":3,"file":"FillGradient.mjs","sources":["../../../../../src/scene/graphics/shared/fill/FillGradient.ts"],"sourcesContent":["import { Color } from '../../../../color/Color';\nimport { DOMAdapter } from '../../../../environment/adapter';\nimport { Matrix } from '../../../../maths/matrix/Matrix';\nimport { type WRAP_MODE } from '../../../../rendering/renderers/shared/texture/const';\nimport { ImageSource } from '../../../../rendering/renderers/shared/texture/sources/ImageSource';\nimport { Texture } from '../../../../rendering/renderers/shared/texture/Texture';\nimport { uid } from '../../../../utils/data/uid';\nimport { deprecation } from '../../../../utils/logging/deprecation';\nimport { definedProps } from '../../../container/utils/definedProps';\n\nimport type { ColorSource } from '../../../../color/Color';\nimport type { PointData } from '../../../../maths/point/PointData';\nimport type { CanvasAndContext } from '../../../../rendering/renderers/shared/texture/CanvasPool';\nimport type { TextureSpace } from '../FillTypes';\n\n/**\n * Defines the type of gradient to create.\n *\n * It can be:\n * - 'linear': A linear gradient that transitions colors along a straight line.\n * - 'radial': A radial gradient that transitions colors in a circular pattern from an inner circle to an outer circle.\n * @category scene\n * @standard\n */\nexport type GradientType = 'linear' | 'radial';\n\n/**\n * Represents the style options for a linear gradient fill.\n * @category scene\n * @standard\n */\nexport interface BaseGradientOptions\n{\n /** The type of gradient */\n type?: GradientType;\n /** Array of colors stops to use in the gradient */\n colorStops?: { offset: number, color: ColorSource }[];\n /** Whether coordinates are 'global' or 'local' */\n textureSpace?: TextureSpace;\n /**\n * The size of the texture to use for the gradient - this is for advanced usage.\n * The texture size does not need to match the size of the object being drawn.\n * Due to GPU interpolation, gradient textures can be relatively small!\n * Consider using a larger texture size if your gradient has a lot of very tight color steps\n */\n textureSize?: number;\n /**\n * The wrap mode of the gradient.\n * This can be 'clamp-to-edge' or 'repeat'.\n * @default 'clamp-to-edge'\n */\n wrapMode?: WRAP_MODE\n}\n\n/**\n * Options specific to linear gradients.\n * A linear gradient creates a smooth transition between colors along a straight line defined by start and end points.\n * @category scene\n * @standard\n */\nexport interface LinearGradientOptions extends BaseGradientOptions\n{\n /** The type of gradient. Must be 'linear' for linear gradients. */\n type?: 'linear';\n\n /**\n * The start point of the gradient.\n * This point defines where the gradient begins.\n * It is represented as a PointData object containing x and y coordinates.\n * The coordinates are in local space by default (0-1), but can be in global space if specified.\n */\n start?: PointData;\n\n /**\n * The end point of the gradient.\n * This point defines where the gradient ends.\n * It is represented as a PointData object containing x and y coordinates.\n * The coordinates are in local space by default (0-1), but can be in global space if specified.\n */\n end?: PointData;\n}\n\n/**\n * Options specific to radial gradients.\n * A radial gradient creates a smooth transition between colors that radiates outward in a circular pattern.\n * The gradient is defined by inner and outer circles, each with their own radius.\n * @category scene\n * @standard\n */\nexport interface RadialGradientOptions extends BaseGradientOptions\n{\n /** The type of gradient. Must be 'radial' for radial gradients. */\n type?: 'radial';\n /** The center point of the inner circle where the gradient begins. In local coordinates by default (0-1). */\n center?: PointData;\n /** The radius of the inner circle where the gradient begins. */\n innerRadius?: number;\n /** The center point of the outer circle where the gradient ends. In local coordinates by default (0-1). */\n outerCenter?: PointData;\n /** The radius of the outer circle where the gradient ends. */\n outerRadius?: number;\n /**\n * The y scale of the gradient, use this to make the gradient elliptical.\n * NOTE: Only applied to radial gradients used with Graphics.\n */\n scale?: number;\n /**\n * The rotation of the gradient in radians, useful for making the gradient elliptical.\n * NOTE: Only applied to radial gradients used with Graphics.\n */\n rotation?: number;\n}\n\n/**\n * Options for creating a gradient fill.\n * @category scene\n * @standard\n */\nexport type GradientOptions = LinearGradientOptions | RadialGradientOptions;\n\n/**\n * If no color stops are provided, we use a default gradient of white to black - this is to avoid a blank gradient if a dev\n * forgets to set them.\n */\nconst emptyColorStops: { offset: number, color: string }[] = [{ offset: 0, color: 'white' }, { offset: 1, color: 'black' }];\n\n/**\n * Class representing a gradient fill that can be used to fill shapes and text.\n * Supports both linear and radial gradients with multiple color stops.\n *\n * For linear gradients, color stops define colors and positions (0 to 1) along a line from start point (x0,y0)\n * to end point (x1,y1).\n *\n * For radial gradients, color stops define colors between two circles - an inner circle centered at (x0,y0) with radius r0,\n * and an outer circle centered at (x1,y1) with radius r1.\n * @example\n * ```ts\n * // Create a vertical linear gradient from red to blue\n * const linearGradient = new FillGradient({\n * type: 'linear',\n * start: { x: 0, y: 0 }, // Start at top\n * end: { x: 0, y: 1 }, // End at bottom\n * colorStops: [\n * { offset: 0, color: 'red' }, // Red at start\n * { offset: 1, color: 'blue' } // Blue at end\n * ],\n * // Use normalized coordinate system where (0,0) is the top-left and (1,1) is the bottom-right of the shape\n * textureSpace: 'local'\n * });\n *\n * // Create a radial gradient from yellow center to green edge\n * const radialGradient = new FillGradient({\n * type: 'radial',\n * center: { x: 0.5, y: 0.5 },\n * innerRadius: 0,\n * outerCenter: { x: 0.5, y: 0.5 },\n * outerRadius: 0.5,\n * colorStops: [\n * { offset: 0, color: 'yellow' }, // Center color\n * { offset: 1, color: 'green' } // Edge color\n * ],\n * // Use normalized coordinate system where (0,0) is the top-left and (1,1) is the bottom-right of the shape\n * textureSpace: 'local'\n * });\n *\n * // Create a rainbow linear gradient in global coordinates\n * const globalGradient = new FillGradient({\n * type: 'linear',\n * start: { x: 0, y: 0 },\n * end: { x: 100, y: 0 },\n * colorStops: [\n * { offset: 0, color: 0xff0000 }, // Red\n * { offset: 0.33, color: 0x00ff00 }, // Green\n * { offset: 0.66, color: 0x0000ff }, // Blue\n * { offset: 1, color: 0xff00ff } // Purple\n * ],\n * textureSpace: 'global' // Use world coordinates\n * });\n *\n * // Create an offset radial gradient\n * const offsetRadial = new FillGradient({\n * type: 'radial',\n * center: { x: 0.3, y: 0.3 },\n * innerRadius: 0.1,\n * outerCenter: { x: 0.5, y: 0.5 },\n * outerRadius: 0.5,\n * colorStops: [\n * { offset: 0, color: 'white' },\n * { offset: 1, color: 'black' }\n * ],\n * // Use normalized coordinate system where (0,0) is the top-left and (1,1) is the bottom-right of the shape\n * textureSpace: 'local'\n * });\n * ```\n *\n * Internally this creates a texture of the gradient then applies a\n * transform to it to give it the correct size and angle.\n *\n * This means that it's important to destroy a gradient when it is no longer needed\n * to avoid memory leaks.\n *\n * If you want to animate a gradient then it's best to modify and update an existing one\n * rather than creating a whole new one each time. That or use a custom shader.\n * @category scene\n * @standard\n */\nexport class FillGradient implements CanvasGradient\n{\n /** Default options for creating a gradient fill */\n public static readonly defaultLinearOptions: LinearGradientOptions = {\n start: { x: 0, y: 0 },\n end: { x: 0, y: 1 },\n colorStops: [],\n textureSpace: 'local',\n type: 'linear',\n textureSize: 256,\n wrapMode: 'clamp-to-edge'\n };\n\n /** Default options for creating a radial gradient fill */\n public static readonly defaultRadialOptions: RadialGradientOptions = {\n center: { x: 0.5, y: 0.5 },\n innerRadius: 0,\n outerRadius: 0.5,\n colorStops: [],\n scale: 1,\n textureSpace: 'local',\n type: 'radial',\n textureSize: 256,\n wrapMode: 'clamp-to-edge'\n };\n\n /**\n * Unique identifier for this gradient instance\n * @internal\n */\n public readonly uid: number = uid('fillGradient');\n /** Type of gradient - currently only supports 'linear' */\n public readonly type: GradientType = 'linear';\n\n /** Internal texture used to render the gradient */\n public texture: Texture;\n /** Transform matrix for positioning the gradient */\n public transform: Matrix;\n /** Array of color stops defining the gradient */\n public colorStops: Array<{ offset: number, color: string }> = [];\n\n /** Whether gradient coordinates are in local or global space */\n public textureSpace: TextureSpace;\n private readonly _textureSize: number;\n\n /** The start point of the linear gradient */\n public start: PointData;\n /** The end point of the linear gradient */\n public end: PointData;\n /** The wrap mode of the gradient texture */\n private readonly _wrapMode: WRAP_MODE;\n\n /** The center point of the inner circle of the radial gradient */\n public center: PointData;\n /** The center point of the outer circle of the radial gradient */\n public outerCenter: PointData;\n /** The radius of the inner circle of the radial gradient */\n public innerRadius: number;\n /** The radius of the outer circle of the radial gradient */\n public outerRadius: number;\n /** The scale of the radial gradient */\n public scale: number;\n /** The rotation of the radial gradient */\n public rotation: number;\n\n /**\n * Creates a new gradient fill. The constructor behavior changes based on the gradient type.\n * @param {GradientOptions} options - The options for the gradient\n * @see {@link LinearGradientOptions}\n * @see {@link RadialGradientOptions}\n */\n constructor(options: GradientOptions);\n /**\n * Deprecated: Use the options object instead.\n * @deprecated since 8.5.2\n * @ignore\n */\n constructor(\n x0?: number,\n y0?: number,\n x1?: number,\n y1?: number,\n textureSpace?: TextureSpace,\n textureSize?: number\n );\n constructor(...args: [GradientOptions] | [number?, number?, number?, number?, TextureSpace?, number?])\n {\n let options = ensureGradientOptions(args);\n\n const defaults = options.type === 'radial' ? FillGradient.defaultRadialOptions : FillGradient.defaultLinearOptions;\n\n options = { ...defaults, ...definedProps(options) };\n\n this._textureSize = options.textureSize;\n this._wrapMode = options.wrapMode;\n\n if (options.type === 'radial')\n {\n this.center = options.center;\n this.outerCenter = options.outerCenter ?? this.center;\n this.innerRadius = options.innerRadius;\n this.outerRadius = options.outerRadius;\n this.scale = options.scale;\n this.rotation = options.rotation;\n }\n else\n {\n this.start = options.start;\n this.end = options.end;\n }\n\n this.textureSpace = options.textureSpace;\n\n this.type = options.type;\n options.colorStops.forEach((stop) =>\n {\n this.addColorStop(stop.offset, stop.color);\n });\n }\n\n /**\n * Adds a color stop to the gradient\n * @param offset - Position of the stop (0-1)\n * @param color - Color of the stop\n * @returns This gradient instance for chaining\n */\n public addColorStop(offset: number, color: ColorSource): this\n {\n this.colorStops.push({ offset, color: Color.shared.setValue(color).toHexa() });\n\n return this;\n }\n\n /**\n * Builds the internal texture and transform for the gradient.\n * Called automatically when the gradient is first used.\n * @internal\n */\n public buildLinearGradient(): void\n {\n if (this.texture) return;\n\n let { x: x0, y: y0 } = this.start;\n let { x: x1, y: y1 } = this.end;\n\n let dx = x1 - x0;\n let dy = y1 - y0;\n\n // Determine flip based on original dx/dy and swap coordinates if necessary\n const flip = dx < 0 || dy < 0;\n\n if (this._wrapMode === 'clamp-to-edge')\n {\n if (dx < 0)\n {\n const temp = x0;\n\n x0 = x1;\n x1 = temp;\n dx *= -1;\n }\n if (dy < 0)\n {\n const temp = y0;\n\n y0 = y1;\n y1 = temp;\n dy *= -1;\n }\n }\n\n const colorStops = this.colorStops.length ? this.colorStops : emptyColorStops;\n\n const defaultSize = this._textureSize;\n\n const { canvas, context } = getCanvas(defaultSize, 1);\n\n const gradient = !flip\n ? context.createLinearGradient(0, 0, this._textureSize, 0)\n : context.createLinearGradient(this._textureSize, 0, 0, 0);\n\n addColorStops(gradient, colorStops);\n\n context.fillStyle = gradient;\n context.fillRect(0, 0, defaultSize, 1);\n\n this.texture = new Texture({\n source: new ImageSource({\n resource: canvas,\n addressMode: this._wrapMode,\n }),\n });\n\n // generate some UVS based on the gradient direction sent\n\n const dist = Math.sqrt((dx * dx) + (dy * dy));\n const angle = Math.atan2(dy, dx);\n\n // little offset to stop the uvs from flowing over the edge..\n // this matrix is inverted when used in the graphics\n // add a tiny off set to prevent uv bleeding..\n const m = new Matrix();\n\n m.scale((dist / defaultSize), 1);\n m.rotate(angle);\n m.translate(x0, y0);\n\n if (this.textureSpace === 'local')\n {\n m.scale(defaultSize, defaultSize);\n }\n this.transform = m;\n }\n\n /**\n * Builds the internal texture and transform for the gradient.\n * Called automatically when the gradient is first used.\n * @internal\n */\n public buildGradient(): void\n {\n if (this.type === 'linear')\n {\n this.buildLinearGradient();\n }\n else\n {\n this.buildRadialGradient();\n }\n }\n\n /**\n * Builds the internal texture and transform for the radial gradient.\n * Called automatically when the gradient is first used.\n * @internal\n */\n public buildRadialGradient(): void\n {\n if (this.texture) return;\n\n const colorStops = this.colorStops.length ? this.colorStops : emptyColorStops;\n\n const defaultSize = this._textureSize;\n const { canvas, context } = getCanvas(defaultSize, defaultSize);\n\n const { x: x0, y: y0 } = this.center;\n const { x: x1, y: y1 } = this.outerCenter;\n\n const r0 = this.innerRadius;\n const r1 = this.outerRadius;\n\n const ox = x1 - r1;\n const oy = y1 - r1;\n\n const scale = defaultSize / (r1 * 2);\n\n const cx = (x0 - ox) * scale;\n const cy = (y0 - oy) * scale;\n\n const gradient = context.createRadialGradient(\n cx,\n cy,\n r0 * scale,\n (x1 - ox) * scale,\n (y1 - oy) * scale,\n r1 * scale\n );\n\n addColorStops(gradient, colorStops);\n\n context.fillStyle = colorStops[colorStops.length - 1].color;\n context.fillRect(0, 0, defaultSize, defaultSize);\n\n context.fillStyle = gradient;\n\n // First translate to center\n context.translate(cx, cy);\n\n // Then apply rotation\n context.rotate(this.rotation);\n\n // Then scale2\n context.scale(1, this.scale);\n\n // Finally translate back, taking scale into account\n context.translate(-cx, -cy);\n\n context.fillRect(0, 0, defaultSize, defaultSize);\n\n this.texture = new Texture({\n source: new ImageSource({\n resource: canvas,\n addressMode: this._wrapMode,\n }),\n });\n\n const m = new Matrix();\n\n // this matrix is inverted when used in the graphics\n m.scale(1 / scale, 1 / scale);\n m.translate(ox, oy);\n\n if (this.textureSpace === 'local')\n {\n m.scale(defaultSize, defaultSize);\n }\n\n this.transform = m;\n }\n\n /**\n * Gets a unique key representing the current state of the gradient.\n * Used internally for caching.\n * @returns Unique string key\n */\n public get styleKey(): number\n {\n return this.uid;\n }\n\n public destroy(): void\n {\n this.texture?.destroy(true);\n this.texture = null;\n }\n}\n\nfunction addColorStops(gradient: CanvasGradient, colorStops: { offset: number, color: string }[]): void\n{\n for (let i = 0; i < colorStops.length; i++)\n {\n const stop = colorStops[i];\n\n gradient.addColorStop(stop.offset, stop.color);\n }\n}\n\nfunction getCanvas(width: number, height: number): CanvasAndContext\n{\n const canvas = DOMAdapter.get().createCanvas(width, height);\n const context = canvas.getContext('2d');\n\n return { canvas, context };\n}\n\n/**\n * Helper function to ensure consistent handling of gradient options.\n * This function handles both the new options object format and the deprecated parameter format.\n * @example\n * // New recommended way:\n * const options = ensureGradientOptions({\n * start: { x: 0, y: 0 },\n * end: { x: 100, y: 100 },\n * textureSpace: 'local'\n * });\n *\n * // Deprecated way (will show warning in debug):\n * const options = ensureGradientOptions([0, 0, 100, 100, 'local']);\n * @param args - Arguments passed to gradient constructor\n * @returns Normalized gradient options object\n * @internal\n */\nfunction ensureGradientOptions(\n args: any[],\n): GradientOptions\n{\n let options = (args[0] ?? {}) as GradientOptions;\n\n // @deprecated\n if (typeof options === 'number' || args[1])\n {\n // #if _DEBUG\n deprecation('8.5.2', `use options object instead`);\n // #endif\n\n options = {\n type: 'linear',\n start: { x: args[0], y: args[1] },\n end: { x: args[2], y: args[3] },\n textureSpace: args[4] as 'global' | 'local',\n textureSize: args[5] ?? FillGradient.defaultLinearOptions.textureSize\n };\n }\n\n return options;\n}\n"],"names":[],"mappings":";;;;;;;;;;AA4HA,MAAM,eAAuD,GAAA,CAAC,EAAE,MAAA,EAAQ,CAAG,EAAA,KAAA,EAAO,OAAQ,EAAA,EAAG,EAAE,MAAA,EAAQ,CAAG,EAAA,KAAA,EAAO,SAAS,CAAA,CAAA;AAkFnH,MAAM,aAAA,GAAN,MAAM,aACb,CAAA;AAAA,EAoFI,eAAe,IACf,EAAA;AAxDA;AAAA;AAAA;AAAA;AAAA,IAAgB,IAAA,CAAA,GAAA,GAAc,IAAI,cAAc,CAAA,CAAA;AAEhD;AAAA,IAAA,IAAA,CAAgB,IAAqB,GAAA,QAAA,CAAA;AAOrC;AAAA,IAAA,IAAA,CAAO,aAAuD,EAAC,CAAA;AAgD3D,IAAI,IAAA,OAAA,GAAU,sBAAsB,IAAI,CAAA,CAAA;AAExC,IAAA,MAAM,WAAW,OAAQ,CAAA,IAAA,KAAS,QAAW,GAAA,aAAA,CAAa,uBAAuB,aAAa,CAAA,oBAAA,CAAA;AAE9F,IAAA,OAAA,GAAU,EAAE,GAAG,QAAA,EAAU,GAAG,YAAA,CAAa,OAAO,CAAE,EAAA,CAAA;AAElD,IAAA,IAAA,CAAK,eAAe,OAAQ,CAAA,WAAA,CAAA;AAC5B,IAAA,IAAA,CAAK,YAAY,OAAQ,CAAA,QAAA,CAAA;AAEz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