mirror of
https://github.com/outline/outline.git
synced 2026-01-04 10:09:52 -06:00
Choose a random color from a shared color palette between backend and frontend during collection creation.
10 lines
255 B
TypeScript
10 lines
255 B
TypeScript
const randomInteger = (min: number, max: number) => {
|
|
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
};
|
|
|
|
const randomElement = <T>(arr: T[]): T => {
|
|
return arr[randomInteger(0, arr.length - 1)];
|
|
};
|
|
|
|
export { randomInteger, randomElement };
|