Skip to main content

Chroma Palette - Text Styling Library

Project description

Chroma Palette - Text Styling Library

The Chroma Palette is a Python module designed to provide comprehensive text styling capabilities for terminal applications. It utilizes ANSI escape codes to apply various styles, colors, decorations, alignments, and shadow effects to text output, enhancing the visual presentation of terminal-based interfaces.

Installation

Install the librery by using pip install chroma-palette

Usage

Import the librery by using from chromapalette import *

Features

Text Styles

  • Bold: Make text bold and prominent.

    styled_text = styled_text("Hello, world!", style=TextStyle.BOLD)
    print(styled_text)
    
  • Italic: Slant text slightly for emphasis.

    styled_text = styled_text("Hello, world!", style=TextStyle.ITALIC)
    print(styled_text)
    
  • Underline: Add a line beneath the text.

    styled_text = styled_text("Hello, world!", style=TextStyle.UNDERLINE)
    print(styled_text)
    
  • Strikethrough: Draw a line through the text.

    styled_text = styled_text("Hello, world!", style=TextStyle.STRIKETHROUGH)
    print(styled_text)
    

Text Colors

Choose from a range of foreground text colors including black, red, green, yellow, blue, magenta, cyan, light gray, dark gray, and more.

  • Example:
    styled_text = styled_text("Hello, world!", color=TextColor.RED)
    print(styled_text)
    

Background Colors

Set background colors for text to improve readability and aesthetics.

  • Example:
    styled_text = styled_text("Hello, world!", background=BackgroundColor.GREEN)
    print(styled_text)
    

Text Decorations

  • Bold: Make text bold and prominent.

    styled_text = styled_text("Hello, world!", decoration=TextDecoration.BOLD)
    print(styled_text)
    
  • Dim: Apply a dim effect to the text.

    styled_text = styled_text("Hello, world!", decoration=TextDecoration.DIM)
    print(styled_text)
    
  • Italic: Slant text slightly for emphasis.

    styled_text = styled_text("Hello, world!", decoration=TextDecoration.ITALIC)
    print(styled_text)
    
  • Underline: Add a line beneath the text.

    styled_text = styled_text("Hello, world!", decoration=TextDecoration.UNDERLINE)
    print(styled_text)
    
  • Blink: Cause the text to blink.

    styled_text = styled_text("Hello, world!", decoration=TextDecoration.BLINK)
    print(styled_text)
    
  • Reverse: Reverse the foreground and background colors.

    styled_text = styled_text("Hello, world!", decoration=TextDecoration.REVERSE)
    print(styled_text)
    
  • Hidden: Hide the text.

    styled_text = styled_text("Hello, world!", decoration=TextDecoration.HIDDEN)
    print(styled_text)
    
  • Strikethrough: Draw a line through the text.

    styled_text = styled_text("Hello, world!", decoration=TextDecoration.STRIKETHROUGH)
    print(styled_text)
    

Text Alignments

Align text to the left, center, or right within the terminal window.

  • Example:
    styled_text = styled_text("Hello, world!", alignment=TextAlignment.CENTER)
    print(styled_text)
    

Dynamic Color Selection

Convert RGB color values to ANSI escape codes for dynamic color selection.

  • Example:
    dynamic_color = dynamic_color_selection(255, 0, 0)  # Red
    styled_text = styled_text("Hello, world!", color=dynamic_color)
    print(styled_text)
    

Interactive Help Menu

Display an interactive help menu with detailed information on available features and usage instructions.

  • Example:
    help()
    

License

This project is licensed under the MIT 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

chroma_palette-1.0.4.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

chroma_palette-1.0.4-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file chroma_palette-1.0.4.tar.gz.

File metadata

  • Download URL: chroma_palette-1.0.4.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for chroma_palette-1.0.4.tar.gz
Algorithm Hash digest
SHA256 7cfbb7077cd1be81cb6e051d47a0cd72cad216ee85b90c5e007591554ab5b61e
MD5 fe0f1f806a01c3707f83d0fcf93497c1
BLAKE2b-256 0edcd187e886c9090cad52e9f08d577d98e26a30d68d636b442256fbeb8e55f9

See more details on using hashes here.

File details

Details for the file chroma_palette-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for chroma_palette-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 49b226ed5c68961f3e1d1e892b86de49babcc6a62b9033ed30a5e69bfec89433
MD5 e474722ed21a9964f56b2757c0dd1bb3
BLAKE2b-256 8028749b711112a7fdaf2636c542987aea95d68a5051836b84611dbc00363e55

See more details on using hashes here.

Supported by

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