feat: Choose random color on collection creation (#3912)
Choose a random color from a shared color palette between backend and frontend during collection creation.
This commit is contained in:
@@ -2,4 +2,8 @@ const randomInteger = (min: number, max: number) => {
|
||||
return Math.floor(Math.random() * (max - min + 1) + min);
|
||||
};
|
||||
|
||||
export { randomInteger };
|
||||
const randomElement = <T>(arr: T[]): T => {
|
||||
return arr[randomInteger(0, arr.length - 1)];
|
||||
};
|
||||
|
||||
export { randomInteger, randomElement };
|
||||
|
||||
Reference in New Issue
Block a user