批量显示十六进制色码

2024-10-03 09:13:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一些十六进制颜色代码:

#ff9b9b
#ff5656
#ff0202
#ad0000
#871515

我想在调色板的同时显示相应的颜色,以便方便地选择我想要的颜色。你知道吗

有什么推荐的在线工具吗?或者我们可以在命令行中完成? 有些工具一次只能显示一种颜色,但我想同时显示几种颜色。你知道吗

非常感谢!你知道吗


Tags: 工具命令行颜色颜色代码调色板ff9b9bad0000ff0202
1条回答
网友
1楼 · 发布于 2024-10-03 09:13:16

如果希望python代码使用colored,那么下面的示例可以选择字体颜色和背景颜色。你知道吗

from colored import fg, bg, attr

color = fg('#C0C0C0') + bg('#00005f') # create font and background color
res = attr('reset') # adding that to string that we print reset current colors

print(color + "Hello World !!!" + res)

相关问题 更多 >