Issue
How to pick a color for a specific color from the array getrandomcolor() and how can i implement it in the item? i figured it out so it gives me random numbers
Solution
You can do something like this:
getRandomColor(){
let colors = ['your1stColor', 'your2ndColor','your3rdColor']; // add your color codes
return colors[Math.floor(Math.random() * colors.length)];
}
And please: do not post images - it's even easier for you to just paste the code and select to format it as block of code, and it will be much easier for everyone trying to help you.
Answered By - Misha Mashina


0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.