创建一个随机的16进制色号 或者 rgb色号
2022-05-24 本文已影响0人
家有饿犬和聋猫
16进制色号: "#" + parseInt(Math.random() * 0xFFFFFF).toString(16);

rgb色号: "rgb(" + parseInt(Math.random()256) + ',' + parseInt(Math.random()256) + ',' + parseInt(Math.random()*256) + ')'

16进制色号: "#" + parseInt(Math.random() * 0xFFFFFF).toString(16);
rgb色号: "rgb(" + parseInt(Math.random()256) + ',' + parseInt(Math.random()256) + ',' + parseInt(Math.random()*256) + ')'