Need help - color string array
Can I color a string array color element (example var myColors = ["red", "blue"]) to show up in that color in Code Playground using JavaScript and CSS? I've looked this up and can't find anything so far. Also it has to be in a textbox... So, I want myColors red to be displayed as a red color; red in red, blue in blue UPDATE var csColors = ["brown", "red", "orange", "yellow", "green", "blue", "violet", "teal"]; So, what I want is for them to show up as their related colors. when it randomly picks a color, I want the user to see it in that same color. I have a light brown background and want the colors to simulate paint on a pallet... I don't think CSS can interact with arrays or functions, as far as I know... This isn't important for the program to run, I just thought it would be cool to see.