Skip to content

Phaser.Display.Color.Interpolate ​

Phaser v4.1.0 · 英文原文

Scope: static

源码:src/display/color/Interpolate.js#L11
引入版本:3.0.0

静态函数 ​

ColorWithColor ​

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

说明:

在所提供长度上将两个给定的颜色对象间插入。

参数:

名称类型可选默认值说明
color1Phaser.Display.Color否第一个颜色对象。
color2Phaser.Display.Color否第二色物标.
lengthnumber是100距离内插到那边去
indexnumber是0索引从.
hsvboolean是false是否在 HSV 中插入 。
hsvSignnumber是0优先使用 HSV 插值。 0 离它最近, 负数总是减少 。 负数总是增加 。

返回值: Phaser.Types.Display.ColorObject - 一个包含插值的物体。

源码:src/display/color/Interpolate.js#L102
引入版本:3.0.0


ColorWithRGB ​

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

说明:

将颜色对象和颜色值之间插入到所提供长度上。

参数:

名称类型可选默认值说明
colorPhaser.Display.Color否颜色对象 。
rnumber否红色价值。
gnumber否绿色价值。
bnumber否蓝值.
lengthnumber是100距离内插到那边去
indexnumber是0索引从.

返回值: Phaser.Types.Display.ColorObject - 一个包含插值的物体。

源码:src/display/color/Interpolate.js#L132
引入版本:3.0.0


HSVWithHSV ​

<static> HSVWithHSV(h1, s1, v1, h2, s2, v2, [length], [index], [sign]) ​

说明:

将两种给定的 HSV 颜色在所提供的长度内进行Interprotection 。 sign 参数控制了 hue 插值的方向: 0 找到最近的路径, 正值总是增加 hue, 负值总是减少 hue 。

参数:

名称类型可选默认值说明
h1number否第一色的色调( 0 到 1 ) 。
s1number否初色饱和度( 0 到 1 ).
v1number否第一色的值(亮度) (0比1).
h2number否第二色的色调(0到1).
s2number否第二色的饱和度( 0 到 1 ) 。
v2number否第二色的值( 亮度) (0 至 1 ) 。
lengthnumber是100距离内插到那边去
indexnumber是0索引从.
signnumber是0色调插向. 0=最近,正数=总增,负数=总减.

返回值: Phaser.Types.Display.ColorObject - 一个包含插值的物体。

源码:src/display/color/Interpolate.js#L55
引入版本:4.0.0


RGBWithRGB ​

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

说明:

将两者间给定的 RGB 颜色值在所提供长度上进行国际化 。

参数:

名称类型可选默认值说明
r1number否红色价值。
g1number否绿色价值。
b1number否蓝值.
r2number否红色价值。
g2number否绿色价值。
b2number否蓝值.
lengthnumber是100距离内插到那边去
indexnumber是0索引从.

返回值: Phaser.Types.Display.ColorObject - 一个包含插值的物体。

源码:src/display/color/Interpolate.js#L17
引入版本:3.0.0



社区翻译