当前位置:网站首页>2 lines of code to generate a solid desktop background
2 lines of code to generate a solid desktop background
2022-07-25 21:48:00 【Interesting Python】
2 Lines of code to achieve a solid desktop background
The core code is just 2 That's ok
Use PIL The library generates a solid color map at a certain resolution
Color code can be referred to : Chinese traditional color collection [1]
The code is as follows :
# coding: utf-8
# Python Solid color diagram
from PIL import Image
SIZE = (1920, 1080)
COLORS = [
("#ff461f", " Cinnabar "),
("#ff2d51", " fiery "),
("#ed5736", " Feise "),
("#f00056", " magenta "),
("#db5a6b", " Begonia red "),
("#c93756", " Cherry "),
("#ff2121", " bright red "),
("#c83c23", " crimson "),
("#9d2933", " Rouge "),
("#ff4c00", " Vermilion "),
("#ff4e20", " Dan "),
("#f35336", " Tong "),
("#cb3a56", " Alizarin "),
("#ff3300", " inflammation "),
("#ff0097", " Magenta "),
("#c32136", " Zaohong "),
("#bf242a", " Silver and Zhu "),
("#c3272b", " red "),
("#dc3023", " Blush "),
("#f05654", " Silver Red "),
]
for index,C in enumerate(COLORS):
im = Image.new('RGB', SIZE, C[0])
im.save('images/{0:02d}'.format(index) + C[1] + '.jpg', quality=95)Code brief description :
SIZE It's resolution , You can adjust it according to your needs
COLORS Is the color code and the corresponding color name
Need to add color COLORS Just add it inside
Wechat insists that this article is not original , I don't know whether it's too many punctuation spaces, not enough words, or whether the written code is similar to others and has been checked again , Here is a lot of useless nonsense of barabarabara, adding up a word effect , I don't know if I can ? If you can see this nonsense , That's enough . ha-ha
design sketch :

Vermilion :




Reference material
[1]
Chinese traditional color collection : https://www.chinavid.com/chinese-color.html
边栏推荐
- 狗粮的成分
- pyqt5使用pyqtgraph绘制多个Y值散点图
- Origen foundation officially launched $ogy stacking, leading a new round of ecological benefits
- The noise reduction effect is increased by more than 6 times! With the microphone inside the headset, this wireless noise reduction headset is unusual!
- LeetCode_ 93_ Restore IP address
- How to implement distributed locks with redis?
- Tesseract OCR初探
- C#常见的集合
- [interview: concurrent 25: multithreading: volatile] visibility
- IJCAI2022开会了! 微软等《领域泛化Domain Generalization》教程
猜你喜欢

ONEFLOW V0.8.0 officially released

ag 搜索工具参数详解

五、品达通用权限系统__pd-tools-xxs(防跨站脚本攻击)
![[hand torn STL] unordered_ set、unordered_ Map (encapsulated with hash table)](/img/33/08f7b72ce99e07821a1f4b6e594e13.png)
[hand torn STL] unordered_ set、unordered_ Map (encapsulated with hash table)

Trusted and controllable way of Tencent cloud database

Byte side: can TCP and UDP use the same port?

Special class design

GPON介绍及华为OLT网关注册配置流程

The adequacy of source evaluation forum · observation model test

2022 love analysis ― bank digitalization practice report
随机推荐
[redis underlying parsing] linked list type
Automatic assembly and fuse degradation of feign
Guys, how can Flink SQL submit tasks in per job mode?
字节一面:TCP 和 UDP 可以使用同一个端口吗?
少儿编程 电子学会图形化编程等级考试Scratch一级真题解析(判断题)2022年6月
redis主从架构锁失效问题(主从)
[leetcode ladder] linked list · 876 find the middle node of the linked list
The noise reduction effect is increased by more than 6 times! With the microphone inside the headset, this wireless noise reduction headset is unusual!
Detailed explanation of several ideas for implementing timed tasks in PHP
How to configure and use rocksdb in the flinksql environment
Lichuang EDA -- creation of devices 01 resistance (II)
Why do independent sellers like to do e-mail marketing? The original conversion rate can be improved so much!
Simple use of protobuf
H5 realize the animation effect of a scratch card
Fastjson deserialization vulnerability utilization analysis collection
Research on the scheme of MySQL advanced (VIII) sorting problem
ORIGYN基金会正式启动$OGY Staking,引领新一轮生态利好
Interviewer of large factory: how to quickly query a table with tens of millions of data?
C#Socket
[interview: concurrent Part 24: multithreading: comprehensive exercise] sequence control