Registry / serialization / colored

colored

JSON →
library2.3.2pypypi✓ verified 25d ago

Colored is a simple Python library (current version 2.3.2) for adding color and formatting to terminal output. It provides a collection of color codes and names, supporting 256-color terminal setups and modern RGB color modes. It maintains an active development status with regular updates, having released version 2.3.2 on March 28, 2026.

pip install colored
INSTALL
IMPORT
SIG · COLORED
C
colored
serializationpythonv2.3.2
Install
1.6s avg
Import
23ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.3.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.024s · 17.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.022s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Fore
from colored import Fore
Back
from colored import Back
Style
from colored import Style

The quickstart demonstrates basic foreground, background, and RGB color usage with f-strings, emphasizing the importance of `Style.reset` to revert terminal formatting.

from colored import Fore, Back, Style print(f'{Fore.white}{Back.green}Colored is Awesome!!!{Style.reset}') print(f'{Fore.rgb(255, 100, 50)}This is a true color text.{Style.reset}')
Debug
Known issues
gotchaAlways remember to apply `Style.reset` after using any colors or formatting. Failing to do so can leave your terminal in a permanently colored or formatted state, affecting subsequent output.
fix
Append `{Style.reset}` to your formatted strings or explicitly call `print(Style.reset)`.
affects: All versions
gotchaWhile `colored` supports 256-color and RGB (true color) modes, not all terminal emulators fully support these advanced features. Older or simpler terminals might only display 8/16 ANSI colors or render escape sequences as plain text.
fix
Test your application on target terminal environments. For maximum compatibility, stick to basic 8/16 ANSI colors if advanced features are not critical or cannot be guaranteed.
affects: All versions, depends on terminal capabilities
deprecatedThe syntax and API have remained relatively stable. Major breaking changes are not widely documented for recent versions. However, `colored` introduced RGB color support in recent versions. Code relying on this feature will not work with older `colored` versions that predate RGB support.
fix
Ensure `colored` is updated to a version that supports RGB for `Fore.rgb()` and `Back.rgb()` functionality. The current version (2.3.2) supports RGB.
affects: <= 2.x.x (exact version for RGB introduction not specified, but newer versions explicitly mention it)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'colored'
The 'colored' library is not installed in the Python environment being used.
fix
Install the library using pip: `pip install colored`
AttributeError: 'builtin_funciton_or_method' object has no attribute 'startswith'
This error typically occurs when attempting to pass a method object (e.g., `str.upper`) instead of the result of calling that method (e.g., `str.upper()`) to a 'colored' function like `fg()` or `bg()`, which expects a string.
fix
Ensure that any string manipulation methods are called with parentheses to return the string value: `col = fg(color.upper())`
TypeError: 'str' object is not callable
This error occurs when attempting to call a color attribute (e.g., `Fore.red` or `Style.reset`) as if it were a function, but these attributes directly return the ANSI escape sequence string.
fix
Remove the parentheses when using direct color attributes: `print(f'{Fore.red}Hello{Style.reset}')`
Upgrade
Version history
2.3.2latest on PyPI · released Mar 28, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
22
OpenAI (training)
1
Resources
colored — pip install colored · libregistry