format
typescript
Gradient.RemoveColorFrame(index)class: Gradient
description
Remove the color keyframe at the specified index.
parameter
| param_name | type | description |
|---|---|---|
| index | number | The index of the keyframe. |
reture
| type | description |
|---|---|
void |
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;
}
// Create a new gradient object
let gradient = new Gradient();
// Add color keyframes
gradient.AddColorFrame(CreateColorFrame(1,0,0,0));
// Set the value of the color keyframe at the specified index
gradient.SetColorFrame(0,CreateColorFrame(1,255,0,0));
// Remove the color keyframe at the specified index
gradient.RemoveColorFrame(1);