码迷,mamicode.com
首页 > 编程语言 > 详细

python 随机生成图片验证码背景RGB-浅色或者深色

时间:2018-12-06 20:50:59      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:背景   class   turn   图片验证码   span   生成   back   pre   port   

1 import random
2 def random_color(is_light = True):
3     return (random.randint(0 ,127) + int(is_light) * 128,random.randint(0,127) + int(is_light) * 128,random.randint(0,127) + int(is_light) * 128)
4 
5 back_color = random_color(is_light= True)

 

python 随机生成图片验证码背景RGB-浅色或者深色

标签:背景   class   turn   图片验证码   span   生成   back   pre   port   

原文地址:https://www.cnblogs.com/chengbo2130/p/10078093.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!