import type { ICanvas, Texture } from '@pixi/core'; /** * Utility methods for Sprite/Texture tinting. * * Tinting with the CanvasRenderer involves creating a new canvas to use as a texture, * so be aware of the performance implications. * @namespace PIXI.canvasUtils * @memberof PIXI */ export declare const canvasUtils: { canvas: ICanvas; /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * @memberof PIXI.canvasUtils * @param {PIXI.Sprite} sprite - the sprite to tint * @param sprite.texture * @param {number} color - the color to use to tint the sprite with * @returns {ICanvas|HTMLImageElement} The tinted canvas */ getTintedCanvas: (sprite: { texture: Texture; }, color: number) => ICanvas | HTMLImageElement; /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * @memberof PIXI.canvasUtils * @param {PIXI.Texture} texture - the sprite to tint * @param {number} color - the color to use to tint the sprite with * @returns {CanvasPattern} The tinted canvas */ getTintedPattern: (texture: Texture, color: number) => CanvasPattern; /** * Tint a texture using the 'multiply' operation. * @memberof PIXI.canvasUtils * @param {PIXI.Texture} texture - the texture to tint * @param {number} color - the color to use to tint the sprite with * @param {PIXI.ICanvas} canvas - the current canvas */ tintWithMultiply: (texture: Texture, color: number, canvas: ICanvas) => void; /** * Tint a texture using the 'overlay' operation. * @memberof PIXI.canvasUtils * @param {PIXI.Texture} texture - the texture to tint * @param {number} color - the color to use to tint the sprite with * @param {PIXI.ICanvas} canvas - the current canvas */ tintWithOverlay: (texture: Texture, color: number, canvas: ICanvas) => void; /** * Tint a texture pixel per pixel. * @memberof PIXI.canvasUtils * @param {PIXI.Texture} texture - the texture to tint * @param {number} color - the color to use to tint the sprite with * @param {PIXI.ICanvas} canvas - the current canvas */ tintWithPerPixel: (texture: Texture, color: number, canvas: ICanvas) => void; /** * Rounds the specified color according to the canvasUtils.cacheStepsPerColorChannel. * @memberof PIXI.canvasUtils * @deprecated since 7.3.0 * @see PIXI.Color.round * @param {number} color - the color to round, should be a hex color * @returns {number} The rounded color. */ roundColor: (color: number) => number; /** * Number of steps which will be used as a cap when rounding colors. * @memberof PIXI.canvasUtils * @deprecated since 7.3.0 * @type {number} */ cacheStepsPerColorChannel: number; /** * Tint cache boolean flag. * @memberof PIXI.canvasUtils * @type {boolean} */ convertTintToImage: boolean; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * @memberof PIXI.canvasUtils * @type {boolean} */ canUseMultiply: boolean; /** * The tinting method that will be used. * @memberof PIXI.canvasUtils * @type {Function} */ tintMethod: (texture: Texture, color: number, canvas: ICanvas) => void; };