Skip to content

Random Background #94

Answered by nftchef
VeriumETH asked this question in Help + Q&A
Discussion options

You must be logged in to vote

hi, it's possible to do something like this, sure!
A possible approach would be to maintain a new Set() of colors, then each time the color is randomly selected, check first that it is not already in the Set [otherwise pick again], then add it to the set after using it.

Although, the difference of even 1 for any RGB value would be considered unique, while visually looking identical to another color. More care and finesse would need to be added to crates steps of noticeably different colors

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by VeriumETH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants