Skip to content

Instantly share code, notes, and snippets.

@aamnah
Created August 5, 2020 05:58
Show Gist options
  • Save aamnah/081157cdbdd5c3f6c3ac9503d3499d3a to your computer and use it in GitHub Desktop.
Save aamnah/081157cdbdd5c3f6c3ac9503d3499d3a to your computer and use it in GitHub Desktop.
get a random color every time
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