Skip to content

Commit

Permalink
web: Remove alpha from name colors
Browse files Browse the repository at this point in the history
  • Loading branch information
schneefux committed Dec 17, 2024
1 parent ee52be6 commit cd0cb47
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion web/components/player/player-aside.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<template v-slot:name="{ row }">
<span
:style="{
color: '#' + (row.nameColor != undefined ? row.nameColor.slice('0x'.length) : 'ffffff'),
color: nameColorHex,
}"
class="font-semibold"
>{{ row.name }}</span>
Expand Down Expand Up @@ -240,6 +240,18 @@ export default defineComponent({
const trackedPlayer = computed(() => preferencesStore.trackedPlayers.find(p => p.tag == props.player.tag))
const canDisableTracking = computed(() => trackingStatus.value == 'active' && trackedPlayer.value != undefined)
const nameColorHex = computed(() => {
const hex = props.player.nameColor?.slice('0x'.length)
if (hex?.length == 6) {
return '#' + hex
}
if (hex?.length == 8) {
// 2024-12-17: name colors have an alpha channel, cut it off
return '#' + hex.slice(-6)
}
return '#ffffff'
})
const rows = computed<Row[]>(() => {
const rows: Row[] = []
rows.push({
Expand Down Expand Up @@ -354,6 +366,7 @@ export default defineComponent({
levelIcon,
calendarIcon,
rankIcons,
nameColorHex,
}
},
})
Expand Down

0 comments on commit cd0cb47

Please sign in to comment.