Skip to main content

A simple fstring-friendly string colorizer

Project description

colors

Colors is a simple library that makes it easier to use colors in fstrings. The standard ansi colors are (in order):

  • Black
  • Red
  • Green
  • Yellow
  • Blue
  • Pink
  • Cyan
  • White

These are accessible in the following variations:

  • (f)ore(g)round
  • (b)ack(g)round
  • (u)nder(line)d
  • (bold)ed
  • (f)ore(g)round_(hi)lighted
  • (b)ack(g)round_(hi)lighted
  • (bold)_(hi)lighted

Forground, Background, Underline, and Bold can all be chained together in any order, as:

f"{uline.blue}{bg.red}red underlined text{reset}"

Highlighted colors must be custom-built due to a difference in how their codes are constructed. This can be done as so:

f"{all_hi(Color.Blue, Color.White, bold=0)}this is white on blue text, unbolded{reset}"

While I may end up figuring out a way around this, it will not be soon. Feel free to use these features as-is.

Installation

$ pip3 install colors

or

$ python3 setup.py install

License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fcolors-0.0.1.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fcolors-0.0.1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file fcolors-0.0.1.tar.gz.

File metadata

  • Download URL: fcolors-0.0.1.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for fcolors-0.0.1.tar.gz
Algorithm Hash digest
SHA256 b6720084a4fdbf6c77c8bc9eb1f32cab0d000d560c9040acd2611016c4619367
MD5 cf0a4e2aed3afb9633e6a689f664147c
BLAKE2b-256 cf633c4c636e0235c64c5abfeea3765e854fa1e953ed2b8de34ce1d8da4e0782

See more details on using hashes here.

File details

Details for the file fcolors-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: fcolors-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for fcolors-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 79a68427d6f775627ab938b1a4f01fd8f34f52a1ee03d915ecd1c8796e1a8cec
MD5 6cd4686436972b3812d41500636db518
BLAKE2b-256 6158e85277a8e511da0d88ee9066d74b3efc4ca2e8da62d35912120bbdaa9e9d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page