Created
August 5, 2020 05:58
-
-
Save aamnah/081157cdbdd5c3f6c3ac9503d3499d3a to your computer and use it in GitHub Desktop.
get a random color every time
This file contains 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 getColor = () => (Math.floor(Math.random() * 255)) | |
const style = { | |
color: `rgb(${getColor()},${getColor()},${getColor()})` | |
} | |
return ( | |
<div> | |
<h4 style={style}>{message}</h4> | |
</div> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment