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.2.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.2-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fcolors-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 a76b0d856fb3aeee21fe85ceedd8c3585103420787a03554bf669d1a11b7b049
MD5 8493da0e0e82dcd9022c8b742734d77a
BLAKE2b-256 744c937897f98759df03dc633c185124966f562f387849f39c1c5205d83ad27b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fcolors-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1e7eb4ad687d1dc90a44d0d6ddb12a3d19662b4fada4caf593edca8323c98c97
MD5 cd7130e2410dbf4e9e945e15867cb1c2
BLAKE2b-256 78434c325e595bea6977639e403659304f8b0c1a1bd3b419f80d0ee5bf2888d0

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