How do you get random RGB in Javascript? [duplicate]
问题 This question already has answers here : Random color generator (52 answers) Closed 5 years ago . I have this code that uses RGB color selection and I was wondering how to make JavaScript do a random color using the RGB method and remember it throughout the code. EDIT: I tried this: var RGBColor1 = (Math.round, Math.random, 255) var RGBColor2 = (Math.round, Math.random, 255) var RGBColor3 = (Math.round, Math.random, 255) but it doesn't work. Help please! EDIT 2: The code uses this: g