Skip to content

Commit

Permalink
Add ID to avatar color generator
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed Jul 11, 2024
1 parent 26edbdb commit 9f22b01
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ export class PrincipalRendererService {
) {
const userInitials = this.getInitials(principal.name);
const colorMode = this.colors.colorMode();
const colorCode = this.colors.toHsl(principal.name, colorMode);
const text = `${principal.id}${principal.name}`;
const colorCode = this.colors.toHsl(text, colorMode);

const fallback = document.createElement('div');
fallback.classList.add('op-principal--avatar');
Expand Down Expand Up @@ -220,9 +221,9 @@ export class PrincipalRendererService {

if (lastSpace === -1) {
return first;
} else {
const last = name[lastSpace + 1]?.toUpperCase();
return [first, last].join('');
}

const last = name[lastSpace + 1]?.toUpperCase();
return [first, last].join('');
}
}

0 comments on commit 9f22b01

Please sign in to comment.