diff --git a/src/utils/color.ts b/src/utils/color.ts index 3e4977a..06afe32 100644 --- a/src/utils/color.ts +++ b/src/utils/color.ts @@ -33,6 +33,9 @@ export const majorBlend = ( data: { weight: number; color: Color }[], base: Color = { r: 0xff, g: 0xff, b: 0xff }, ) => { + if (data.length === 1) { + return data[0].color; + } const major = data.reduce((a, b) => (a.weight > b.weight ? a : b), { weight: 0, color: { r: 0, g: 0, b: 0 },