From 8878a118f2ce3f97f00ea9e42f3f2a4efb2eeef2 Mon Sep 17 00:00:00 2001 From: Zeke Chan Date: Mon, 6 Jan 2025 17:46:04 +0800 Subject: [PATCH] Fixed #6979. `Interpolate.ColorWithColor` returns all ColorObject properties --- src/display/color/Interpolate.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/display/color/Interpolate.js b/src/display/color/Interpolate.js index 364b13e6b8..7035e355ae 100644 --- a/src/display/color/Interpolate.js +++ b/src/display/color/Interpolate.js @@ -5,6 +5,7 @@ */ var Linear = require('../../math/Linear'); +var GetColor = require('./GetColor'); /** * @namespace Phaser.Display.Color.Interpolate @@ -37,11 +38,16 @@ var RGBWithRGB = function (r1, g1, b1, r2, g2, b2, length, index) if (index === undefined) { index = 0; } var t = index / length; + var r = Linear(r1, r2, t); + var g = Linear(g1, g2, t); + var b = Linear(b1, b2, t); return { - r: Linear(r1, r2, t), - g: Linear(g1, g2, t), - b: Linear(b1, b2, t) + r: r, + g: g, + b: b, + a: 255, + color: GetColor(r, g, b) }; };