mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-20 10:19:08 +00:00
13 lines
363 B
TypeScript
13 lines
363 B
TypeScript
// Copyright 2021 Signal Messenger, LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
import lodash from 'lodash';
|
|
import type { AvatarColorType } from '../types/Colors.std.js';
|
|
import { AvatarColors } from '../types/Colors.std.js';
|
|
|
|
const { sample } = lodash;
|
|
|
|
export function getRandomColor(): AvatarColorType {
|
|
return sample(AvatarColors) || AvatarColors[0];
|
|
}
|