From 8cccf5184868f04a56766dcaa5b9c4f7450c1605 Mon Sep 17 00:00:00 2001 From: DomWane Date: Thu, 3 Oct 2024 15:55:41 +0200 Subject: [PATCH] feat: added no score state colors --- components/Project/ProjectRating.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/Project/ProjectRating.vue b/components/Project/ProjectRating.vue index df6158f..c3d77c7 100644 --- a/components/Project/ProjectRating.vue +++ b/components/Project/ProjectRating.vue @@ -14,7 +14,7 @@ const props = defineProps<{ const emits = defineEmits(['selected']) const colors = [ - '#EA171D', // 0-10% + '#EA171D', // 1-10% '#FB2D00', // 11-20% '#FD6515', // 21-30% '#FD941A', // 31-40% @@ -29,6 +29,8 @@ const colors = [ const backgroundColorByScore = computed(() => { if (props.percentage === 100) return '#42FF00' + if (props.percentage === 0) + return '#494949' const normalizedPercentage = Math.min(Math.max(props.percentage, 0), 100) const colorIndex = Math.floor(normalizedPercentage / 10) return colors[colorIndex]