mirror of
https://github.com/web3privacy/explorer-app.git
synced 2024-10-15 16:46:26 +02:00
feat: added no score state colors
This commit is contained in:
parent
dfbcd7b570
commit
8cccf51848
1 changed files with 3 additions and 1 deletions
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue