{"id":2801,"library":"tcolorpy","title":"tcolorpy","description":"tcolorpy is a Python library designed to apply true color (24-bit RGB) for terminal text, providing a rich set of methods to style strings with foreground, background, and various ANSI effects. The current version is 0.1.7, and the project maintains an active, though not rapid, release cadence with a focus on Python version compatibility and packaging improvements.","status":"active","version":"0.1.7","language":"en","source_language":"en","source_url":"https://github.com/thombashi/tcolorpy","tags":["terminal","color","text","cli","ansi","rgb"],"install":[{"cmd":"pip install tcolorpy","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"Color","correct":"from tcolorpy import Color"},{"symbol":"RgbColor","correct":"from tcolorpy import RgbColor"},{"symbol":"AnsiFgColor","correct":"from tcolorpy import AnsiFgColor"},{"note":"Commonly imported as 'color' for direct access to predefined colors and functions.","symbol":"tcolorpy (as color)","correct":"import tcolorpy as color"}],"quickstart":{"code":"import tcolorpy as color\n\n# Basic red text\nprint(color.RED('Hello, tcolorpy!'))\n\n# Custom RGB color with bold style\nprint(color.RgbColor(255, 100, 0, 'Orange Bold Text').bold())\n\n# 256-color foreground and background\nprint(color.AnsiFgColor(27, 'Deep Green FG') + color.AnsiBgColor(235, ' Dark Gray BG'))\n\n# Check if the terminal supports true colors\nif color.is_true_color_terminal():\n    print(color.BLUE('Your terminal supports true colors!'))\nelse:\n    print(color.YELLOW('True color support not detected.'))\n","lang":"python","description":"Demonstrates basic usage of predefined colors, custom RGB, 256-color ANSI codes, and checking terminal true color capability."},"warnings":[{"fix":"Upgrade Python to 3.9+ or install 'tcolorpy<0.1.7'.","message":"Support for Python 3.7 and 3.8 was dropped in version 0.1.7. Users on these Python versions must upgrade their Python interpreter or pin 'tcolorpy' to a version less than 0.1.7.","severity":"breaking","affected_versions":">=0.1.7"},{"fix":"Upgrade Python to 3.7+ (preferably 3.9+) or install 'tcolorpy<0.1.3'.","message":"Support for Python 3.6 was dropped in version 0.1.3. Users on Python 3.6 must install 'tcolorpy' to a version less than 0.1.3.","severity":"breaking","affected_versions":">=0.1.3"},{"fix":"Ensure `tcolorpy.enable()` has been called if colors are not displaying as expected. These functions affect the global state.","message":"The `tcolorpy.disable()` and `tcolorpy.enable()` functions globally control whether colors are rendered. If you find colors are unexpectedly not appearing, verify that coloring hasn't been disabled.","severity":"gotcha","affected_versions":"All"},{"fix":"Consider checking `tcolorpy.is_true_color_terminal()` before applying true colors, or be aware that fallback to 256-color or basic ANSI colors may be necessary for broader compatibility.","message":"Terminal true color (24-bit RGB) support is not universal across all terminal emulators and operating systems. While `tcolorpy` includes `is_true_color_terminal()` for detection, colors may not render as intended if the user's terminal lacks full support.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}