Phaser API Documentation

  Version: 
Filter
This is a beta release of our new docs system. Found an issue?
Please tell us about it in the #📖-newdocs-feedback channel on the Phaser Discord
Namespace: Interpolate
Phaser.Display.Color.Interpolate

Methods

<static> RGBWithRGB(r1, g1, b1, r2, g2, b2, [length], [index])
Focus
Focus

Description:

Interpolates between the two given color ranges over the length supplied.

Parameters:

name type arguments Default description
r1 number

Red value.

g1 number

Blue value.

b1 number

Green value.

r2 number

Red value.

g2 number

Blue value.

b2 number

Green value.

length number <optional> 100

Distance to interpolate over.

index number <optional> 0

Index to start from.

Returns:
Description:

An object containing the interpolated color values.

Examples:
Since: 3.0.0
Focus
Focus
<static> ColorWithColor(color1, color2, [length], [index])
Focus
Focus

Description:

Interpolates between the two given color objects over the length supplied.

Parameters:

name type arguments Default description
color1 Phaser.Display.Color

The first Color object.

color2 Phaser.Display.Color

The second Color object.

length number <optional> 100

Distance to interpolate over.

index number <optional> 0

Index to start from.

Returns:
Description:

An object containing the interpolated color values.

Examples:
Since: 3.0.0
Focus
Focus
<static> ColorWithRGB(color1, r, g, b, [length], [index])
Focus
Focus

Description:

Interpolates between the Color object and color values over the length supplied.

Parameters:

name type arguments Default description
color1 Phaser.Display.Color

The first Color object.

r number

Red value.

g number

Blue value.

b number

Green value.

length number <optional> 100

Distance to interpolate over.

index number <optional> 0

Index to start from.

Returns:
Description:

An object containing the interpolated color values.

Examples:
Since: 3.0.0
Focus
Focus