【根据数组元素生成随机颜色函数】
const colorOptions = ["#f50","#2db7f5","#87d068","#108ee9",];const getRandomColor = () => {const randomIndex = Math.floor(Math.random() * colorOptions.length);return colorOptions[randomIndex];};
时小记,终有成。
const colorOptions = ["#f50","#2db7f5","#87d068","#108ee9",];const getRandomColor = () => {const randomIndex = Math.floor(Math.random() * colorOptions.length);return colorOptions[randomIndex];};
时小记,终有成。