Skip to content

Instantly share code, notes, and snippets.

@alexko30
Created August 14, 2018 23:17
Show Gist options
  • Save alexko30/98954f20c206c014ca9748c4fcca7b75 to your computer and use it in GitHub Desktop.
Save alexko30/98954f20c206c014ca9748c4fcca7b75 to your computer and use it in GitHub Desktop.
interpolate(startValue, destValue, progress, data) {
const r = lerp(startValue.color[0], destValue.color[0], progress);
const g = lerp(startValue.color[1], destValue.color[1], progress);
const b = lerp(startValue.color[2], destValue.color[2], progress);
const a = lerp(startValue.valpha, destValue.valpha, progress);
const color = Color.rgb(r, g, b, a)[data.format === 'rgba' ? 'rgb' : data.format]();
return typeof color === 'string' ? color : color.string();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment