本博客主要用python语言随机生成RGB代码,如下:
import random def randomcolor(): colorArr = ['1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'] color = "" for i in range(6): color += colorArr[random.randint(0,14)] return "#"+color
实验结果:
本博客主要用python语言随机生成RGB代码,如下:
import random def randomcolor(): colorArr = ['1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'] color = "" for i in range(6): color += colorArr[random.randint(0,14)] return "#"+color
实验结果: