Skip to content

Commit

Permalink
bezier: properly complain when number of colors is bad
Browse files Browse the repository at this point in the history
Maybe I should've generalized the 5 case into a bisecting or windowed implementation, but I am too lazy to actually test that.

Fixes #245.
  • Loading branch information
Artoria2e5 authored and gka committed Jan 27, 2022
1 parent 2d7dab5 commit 5612043
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/generator/bezier.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const bezier = function(colors) {
return I1((t-0.5)*2);
}
};
} else {
throw new RangeError("Bezier can only accept between 2 to 5 colors; got `${colors.length}`.")
}
return I;
};
Expand Down

0 comments on commit 5612043

Please sign in to comment.