Phaser.Display.Color.Interpolate

Scope: static

Source: src/display/color/Interpolate.js#L9
Since: 3.0.0

Methods:

Public Members

ColorWithColor

<static> ColorWithColor(color1, color2, [length], [index])

Description:

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

Parameters:

nametypeoptionaldefaultdescription
color1Phaser.Display.ColorNoThe first Color object.
color2Phaser.Display.ColorNoThe second Color object.
lengthnumberYes100Distance to interpolate over.
indexnumberYes0Index to start from.

Returns: Phaser.Types.Display.ColorObject - An object containing the interpolated color values.

Source: src/display/color/Interpolate.js#L48
Since: 3.0.0


ColorWithRGB

<static> ColorWithRGB(color1, r, g, b, [length], [index])

Description:

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

Parameters:

nametypeoptionaldefaultdescription
color1Phaser.Display.ColorNoThe first Color object.
rnumberNoRed value.
gnumberNoBlue value.
bnumberNoGreen value.
lengthnumberYes100Distance to interpolate over.
indexnumberYes0Index to start from.

Returns: Phaser.Types.Display.ColorObject - An object containing the interpolated color values.

Source: src/display/color/Interpolate.js#L71
Since: 3.0.0


RGBWithRGB

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

Description:

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

Parameters:

nametypeoptionaldefaultdescription
r1numberNoRed value.
g1numberNoBlue value.
b1numberNoGreen value.
r2numberNoRed value.
g2numberNoBlue value.
b2numberNoGreen value.
lengthnumberYes100Distance to interpolate over.
indexnumberYes0Index to start from.

Returns: Phaser.Types.Display.ColorObject - An object containing the interpolated color values.

Source: src/display/color/Interpolate.js#L15
Since: 3.0.0


Private Members

Updated on