This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const getRandomColor = () => { | |
| const h = Math.floor(Math.random() * 360), | |
| s = Math.floor(Math.random() * 100) + '%', | |
| l = Math.floor(Math.random() * 60) + '%';// max value of l is 100, but I set to 60 cause I want to generate dark colors | |
| // (use for background with white/light font color) | |
| return `hsl(${h},${s},${l})`; | |
| }; |