Skip to content

Commit 94482b7

Browse files
Fix initials color of new avatars
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
1 parent eb2a357 commit 94482b7

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/components/NcAvatar/NcAvatar.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export default {
129129
:class="'avatardiv__user-status--' + userStatus.status" />
130130

131131
<!-- Show the letter if no avatar nor icon class -->
132-
<div v-if="userDoesNotExist && !(iconClass || $slots.icon)" class="unknown">
132+
<div v-if="userDoesNotExist && !(iconClass || $slots.icon)" :style="initialsStyle" class="unknown">
133133
{{ initials }}
134134
</div>
135135
</div>
@@ -405,6 +405,12 @@ export default {
405405
}
406406
return style
407407
},
408+
initialsStyle() {
409+
const { r, g, b } = usernameToColor(this.getUserIdentifier)
410+
return {
411+
color: `rgb(${r}, ${g}, ${b})`,
412+
}
413+
},
408414
tooltip() {
409415
if (this.disableTooltip) {
410416
return false
@@ -711,7 +717,6 @@ export default {
711717
width: 100%;
712718
text-align: center;
713719
font-weight: normal;
714-
color: var(--color-main-background);
715720
}
716721
717722
img {

0 commit comments

Comments
 (0)