#

API Docs for: 1.5.0
Show: Inherited Protected Private Deprecated

# CanvasTinter Class

Defined in: `src/pixi/renderers/canvas/utils/CanvasTinter.js:8`
Module: PIXI

## Constructor

### `CanvasTinter`

() static

Defined in `src/pixi/renderers/canvas/utils/CanvasTinter.js:8`

- Index
- Methods
- Properties

## Item Index

### Methods

- getTintedTexture
- roundColor
- tintPerPixel
- tintWithMultiply
- tintWithOverlay

### Properties

- cacheStepsPerColorChannel
- canUseMultiply
- convertTintToImage

## Methods

### `getTintedTexture`

(

- `sprite`
- `color`

)

Defined in `src/pixi/renderers/canvas/utils/CanvasTinter.js:21`

Basically this method just needs a sprite and a color and tints the sprite with the given color

#### Parameters:

- `sprite` Sprite

  the sprite to tint

- `color` Number

  the color to use to tint the sprite with

### `roundColor`

(

- `color`

)

Defined in `src/pixi/renderers/canvas/utils/CanvasTinter.js:197`

Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel

#### Parameters:

- `color` Number

  the color to round, should be a hex color

### `tintPerPixel`

(

- `texture`
- `color`
- `canvas`

)

Defined in `src/pixi/renderers/canvas/utils/CanvasTinter.js:153`

Tint a texture pixel per pixel

#### Parameters:

- `texture` Texture

  the texture to tint

- `color` Number

  the color to use to tint the sprite with

- `canvas` HTMLCanvasElement

  the current canvas

### `tintWithMultiply`

(

- `texture`
- `color`
- `canvas`

)

Defined in `src/pixi/renderers/canvas/utils/CanvasTinter.js:70`

Tint a texture using the "multiply" operation

#### Parameters:

- `texture` Texture

  the texture to tint

- `color` Number

  the color to use to tint the sprite with

- `canvas` HTMLCanvasElement

  the current canvas

### `tintWithOverlay`

(

- `texture`
- `color`
- `canvas`

)

Defined in `src/pixi/renderers/canvas/utils/CanvasTinter.js:115`

Tint a texture using the "overlay" operation

#### Parameters:

- `texture` Texture

  the texture to tint

- `color` Number

  the color to use to tint the sprite with

- `canvas` HTMLCanvasElement

  the current canvas

## Properties

### `cacheStepsPerColorChannel`

Number

Defined in `src/pixi/renderers/canvas/utils/CanvasTinter.js:215`

Number of steps which will be used as a cap when rounding colors

### `canUseMultiply`

Boolean

Defined in `src/pixi/renderers/canvas/utils/CanvasTinter.js:232`

Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method

### `convertTintToImage`

Boolean

Defined in `src/pixi/renderers/canvas/utils/CanvasTinter.js:223`

Number of steps which will be used as a cap when rounding colors