Skip to content

Commit 037ffc1

Browse files
feat: hue shift % based color change for scores
1 parent cfa8db0 commit 037ffc1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/components/Package/ScoreGauges.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ const scoreMetrics = computed(() => {
2727
})
2828
2929
function getScoreColor(percentage: number): string {
30-
if (percentage < 40) return 'oklch(0.55 0.12 25)'
31-
if (percentage < 70) return 'oklch(0.6 0.1 85)'
32-
return 'oklch(0.55 0.1 145)'
30+
// Interpolate hue from red (25) to green (145) based on percentage
31+
const hue = 25 + (percentage / 100) * (145 - 25)
32+
return `oklch(0.55 0.12 ${hue})`
3333
}
3434
</script>
3535

0 commit comments

Comments
 (0)