signal-desktop/ts/test-helpers/getRandomColor.ts

11 lines
325 B
TypeScript
Raw Normal View History

2021-08-05 20:17:05 -04:00
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { sample } from 'lodash';
2025-06-26 12:24:07 -04:00
import type { AvatarColorType } from '../types/Colors';
import { AvatarColors } from '../types/Colors';
2021-08-05 20:17:05 -04:00
export function getRandomColor(): AvatarColorType {
return sample(AvatarColors) || AvatarColors[0];
}