# fatih/color

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/fatih-color).**

7,883 stars · 635 forks · Go · mit

## Links

- GitHub: https://github.com/fatih/color
- Homepage: https://pkg.go.dev/github.com/fatih/color
- awesome-repositories: https://awesome-repositories.com/repository/fatih-color.md

## Topics

`ansi` `color` `coloring` `go` `golang`

## Description

This is an ANSI terminal color library and console output manager used for applying colors and text attributes to command line interface output. It functions as a terminal text styler and RGB color formatter, generating the escape codes necessary for foreground and background styling.

The project supports 24-bit high-color RGB mapping for precise color rendering in compatible terminal emulators. It enables the creation of colorized text fragments that can be embedded into larger blocks of text or applied as global styles that persist across subsequent output streams.

The library covers broad terminal styling capabilities, including the application of visual attributes such as bold, underline, italic, and blinking text. It includes a system for redirecting formatted output to custom streams and provides logic to toggle color visibility based on environment variables and terminal detection.

## Tags

### User Interface & Experience

- [Terminal Text Coloring](https://awesome-repositories.com/f/user-interface-experience/terminal-text-coloring.md) — Controls the use of ANSI escape codes to ensure text is colored correctly across different terminal emulators.
- [Terminal Color Formatting](https://awesome-repositories.com/f/user-interface-experience/component-utilities/color-utilities/terminal-color-formatting.md) — Manages color output globally or for specific definitions via environment variables, flags, or terminal detection. ([source](https://cdn.jsdelivr.net/gh/fatih/color@main/README.md))
- [Terminal Text Styling](https://awesome-repositories.com/f/user-interface-experience/terminal-text-styling.md) — Adds colors and visual attributes like bold or underline to command line output to improve readability.
- [Terminal Text Attributes](https://awesome-repositories.com/f/user-interface-experience/text-formatting-tools/terminal-text-attributes.md) — Applies visual attributes like bold, underline, italic, and blinking text to command line output. ([source](https://pkg.go.dev/github.com/fatih/color))
- [True Color Support](https://awesome-repositories.com/f/user-interface-experience/true-color-support.md) — Supports 24-bit high-color RGB mapping for precise foreground and background rendering in compatible terminals. ([source](https://pkg.go.dev/github.com/fatih/color))
- [Colorized Text Fragments](https://awesome-repositories.com/f/user-interface-experience/colorized-text-fragments.md) — Generates individual colorized segments that can be concatenated into larger formatted text blocks.
- [Command Line Interface Design](https://awesome-repositories.com/f/user-interface-experience/command-line-interface-design.md) — Formats terminal output for tools and scripts to provide clear visual cues and a professional user interface.
- [RGB Color Formatting](https://awesome-repositories.com/f/user-interface-experience/rgb-color-formatting.md) — Generates 24-bit high-color foreground and background styles for modern terminal emulators.
- [RGB Color Mapping](https://awesome-repositories.com/f/user-interface-experience/rgb-color-mapping.md) — Translates RGB color values into high-color ANSI sequences for precise terminal color rendering.
- [Persistent Styles](https://awesome-repositories.com/f/user-interface-experience/terminal-text-styling/persistent-styles.md) — Provides the ability to apply a specific color or style globally to all subsequent terminal output. ([source](https://cdn.jsdelivr.net/gh/fatih/color@main/README.md))

### Development Tools & Productivity

- [Output Style Customization](https://awesome-repositories.com/f/development-tools-productivity/console-color-mappings/output-style-customization.md) — Controls color visibility and redirects formatted strings to different output streams.

### Operating Systems & Systems Programming

- [ANSI Escape Sequence Renderers](https://awesome-repositories.com/f/operating-systems-systems-programming/terminal-command-line-environments/terminal-management/output-rendering-engines/ansi-escape-sequence-renderers.md) — Generates raw terminal control codes to manipulate text color and formatting within a command-line interface.
- [Runtime Environment Detection](https://awesome-repositories.com/f/operating-systems-systems-programming/runtime-environment-detection.md) — Determines color output based on terminal detection and environment variable flags during runtime.
- [Terminal Output](https://awesome-repositories.com/f/operating-systems-systems-programming/terminal-command-line-environments/terminal-interface-systems/terminal-output.md) — Writes colorized text to specific output streams and buffers rather than just printing to the standard console.

### Web Development

- [Terminal Text Stylers](https://awesome-repositories.com/f/web-development/terminal-text-stylers.md) — Adds bold, underline, and italic formatting to command line interface text.
