Personal font color utility library for Python
Project description
zyjared-color
安装
pip install zyjared-color
使用
from zyjared_color import color, Color
content = color('Hello World!').red() + ' -+-+-+- test'
text = f'{color("Hello World!").blue():<15} -+-+-+- test'
content = color(text)
拓展
from zyjared_color import zprint
zprint([
'Hello',
'World!',
])
zprint({
'Hello': 'World!'
'Hello': ['World!']
'Hello': {
'World!': 'Hello World!'
}
})
HTML / CSS
from zyjared_color.html import ColorHtml, StaticColorHtml
from zyjared_color.html import blue, red, bold, italic, underline, through
text = ColorHtml('Hello World!').red().bold()
print(text)
# custom styles
text = ColorHtml("Hello World!", {"opacity": 0.5, "font-weight": "bold"})
print(text)
example: Display ColorHtml
in Jupyter Notebook
from zyjared_color.html import ColorHtml as Color, StaticColorHtml as StaticColor
from zyjared_color.html import blue, red, bold, italic, underline, through
from IPython.display import display, HTML
text = Color('Hello World!').red().bold()
# f'{text}' or str(text)
display(HTML(f'{text}'))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
zyjared_color-0.5.6.tar.gz
(9.0 kB
view details)
Built Distribution
File details
Details for the file zyjared_color-0.5.6.tar.gz
.
File metadata
- Download URL: zyjared_color-0.5.6.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d411b987815bc9648cb858e0d6a850d8d45c352fb2384edf371a4ffcb6201c64 |
|
MD5 | 31540bc08111320c6d95a3121583cd10 |
|
BLAKE2b-256 | 126ec0c480243a619c90a21a0005f12f15d4acd71b32a9509cbdb418acd88ee9 |
File details
Details for the file zyjared_color-0.5.6-py3-none-any.whl
.
File metadata
- Download URL: zyjared_color-0.5.6-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c4909ea6f3dafde630e051f5f74d658195441cd2e034a5925ec1736f2a963a6 |
|
MD5 | b0b2bda554963d4b5acc2a9c546accad |
|
BLAKE2b-256 | 41fdd9fb1f95baa9dcea262703ad7853805ea8d354c91bd6d10013ca8cc8ab3a |