()
| 15 | * Swap this for your authenticated user when adapting the starter. |
| 16 | */ |
| 17 | export function createIdentity(): Peer { |
| 18 | const adjective = ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)] |
| 19 | const animal = ANIMALS[Math.floor(Math.random() * ANIMALS.length)] |
| 20 | // Spread the hue across the wheel for distinct, readable cursor colors. |
| 21 | const hue = Math.floor(Math.random() * 360) |
| 22 | |
| 23 | return { |
| 24 | id: crypto.randomUUID(), |
| 25 | name: `${adjective} ${animal}`, |
| 26 | color: `hsl(${hue} 85% 60%)`, |
| 27 | } |
| 28 | } |