Skip to content

Commit

Permalink
check for undefined value
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton-Mushnin committed Mar 23, 2024
1 parent 4913e28 commit f5ca363
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions web/src/utils/colors.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
const colors: string[] = ["#2f38c0", "#5f64cf", "#8c91dc", "#e38b87", "#d65c5a"];

function interpolateColor(color1: string, color2: string, factor = 0.5): string {
if (!color1 || !color2) {
return colors[0];
}
const color1Match = color1.slice(1).match(/.{2}/g);
const color2Match = color2.slice(1).match(/.{2}/g);

Expand Down

0 comments on commit f5ca363

Please sign in to comment.