Skip to content

Commit

Permalink
refactor(color): update multiCosineGradient()
Browse files Browse the repository at this point in the history
- update tween() args due to API change
  • Loading branch information
postspectacular committed Nov 9, 2019
1 parent 5523582 commit 0359d4a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions packages/color/src/cosine-gradients.ts
Expand Up @@ -185,10 +185,19 @@ export const cosineCoeffs = (from: ReadonlyColor, to: ReadonlyColor) => {
*
* @see thi.ng/transducers/iter/tween
*
* @param n
* @param num
* @param stops
*/
export const multiCosineGradient = (
n: number,
num: number,
...stops: [number, ReadonlyColor][]
): Color[] => [...tween(n, 0, 1, cosineCoeffs, cosineColor, ...stops)];
): Color[] => [
...tween({
num,
min: 0,
max: 1,
init: cosineCoeffs,
mix: cosineColor,
stops
})
];

0 comments on commit 0359d4a

Please sign in to comment.