当前位置:网站首页>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
边栏推荐
- MPI学习笔记(二):矩阵相乘的两种实现方法
- Ijcai2022 meeting! Microsoft and other tutorials on domain generalization
- Create EDA - why should I learn EDA
- 919. Complete binary tree inserter: simple BFS application problem
- 立创EDA——我为什么要学EDA
- Tesseract OCR初探
- I/o case practice
- Zero basic learning canoe panel (17) -- panel CAPL function
- 【饭谈】测试平台为什么有组件化?模块化?很多看不到的地方设计的很好是种浪费么?
- Does the open source agreement have legal effect?
猜你喜欢

strcpy()
![[redis underlying parsing] linked list type](/img/e8/c192629dce1a958155a562d216d532.png)
[redis underlying parsing] linked list type

如何用 Redis 实现分布式锁的?

Optimization analysis of storage structure and IO performance of openharmony littlefs file system

GPON introduction and Huawei OLT gateway registration and configuration process

How to implement distributed locks with redis?

Detailed explanation of JVM memory model and structure (five model diagrams)

5、 Pinda general permission system__ PD tools XXS (anti cross site script attack)
![[interview: concurrent Article 23: multithreading: Join] re understanding of join](/img/ee/5160a55e776336ba844abe8e9db72a.png)
[interview: concurrent Article 23: multithreading: Join] re understanding of join

Special class design
随机推荐
Isn't it too much to play Gobang in idea?
【面试:并发篇24:多线程:综合练习】顺序控制
GPON介绍及华为OLT网关注册配置流程
Guys, how can Flink SQL submit tasks in per job mode?
At present, flynk CDC does not support mysql5.5. If you change the source code and release this restriction, there will be a lot of data problems?
Create files, file permissions, ownership, and sticky bits
How to evaluate hardware resources (number of CPUs, memory size) when Oracle migrates from small computers to x86 architecture? Is there a measurement index or company?
Experience sharing of system architecture designers preparing for the exam: from point to surface
On Web Performance Optimization (1)
【测开方法论】测开平台pk心得-抉择
Vivo official website app full model UI adaptation scheme
Ability to choose
函数栈帧的创建和销毁
Optimization analysis of storage structure and IO performance of openharmony littlefs file system
LeetCode_ 93_ Restore IP address
C#Socket
New maixhub deployment (v831 and k210)
少儿编程 电子学会图形化编程等级考试Scratch一级真题解析(判断题)2022年6月
开源的RSS订阅器FreshRSS
Idea resolves the prompt of profile properties disappear