format
typescript
KeyFrameColorRGB.Lerp(lhs, rhs, weight)class: KeyFrameColorRGB
description
Get the interpolated color between two colors.
parameter
| param_name | type | description |
|---|---|---|
| lhs | KeyFrameColorRGB | The left keyframe. |
| rhs | KeyFrameColorRGB | The right keyframe. |
| weight | number | The weight. |
return
| type | description |
|---|---|
Color | The interpolated color between two colors. |
code example
typescript
function CreateColorFrame(time:number,r:number,g:number,b:number):KeyFrameColorRGB
{
let colorFrame=new KeyFrameColorRGB();
colorFrame.time=time;
colorFrame.r=r;
colorFrame.g=g;
colorFrame.b=b;
return colorFrame;
}
let colorFrame1 = CreateColorFrame(1,0,0,0);
let colorFrame2 = CreateColorFrame(1,255,0,0);
// Get the interpolated color between two colors
let color = KeyFrameColorRGB.Lerp(colorFrame1, colorFrame2, 0.5);