colorTest.c
is a simple C program designed to display various foreground and background color combinations in the terminal using ANSI escape codes. It can be run in most Unix-like shells, making it a terminal-agnostic, cross-platform color testing tool.
- Displays 8 foreground and background color combinations.
- Supports bold and normal text styles.
- Runs on any terminal that supports ANSI escape sequences.
- Useful for testing and customizing terminal color schemes.
To compile and run colorTest.c
, you'll need:
- A C compiler such as
gcc
. - A Unix-like environment (Linux, macOS, or WSL on Windows).
- A terminal that supports ANSI escape sequences.
-
Clone or download this repository.
-
Open a terminal and navigate to the folder containing
colorTest.c
. -
Compile the program using the following command:
$ gcc colortest.c -o colortest
The program uses ANSI escape codes to control text styling and coloring in the terminal. It loops through various foreground and background colors and applies different text styles (normal and bold) to display the combinations.
- Foreground colors:
30
to37
- Background colors:
40
to47
- Text styles: Normal and Bold
The grid produced shows the ANSI codes applied to the text gYw
and gYm
, which lets you visually test and verify color combinations in your terminal environment.
- The program is compatible with any Unix-like shell (bash, zsh, etc.) that supports ANSI escape sequences.
- It should work on macOS, Linux, and Windows Subsystem for Linux (WSL).
You can download the latest precompiled binaries for Linux, macOS, and Windows from the Releases page.
-
Go to the Releases page.
-
Download the appropriate binary for your operating system:
- colortest-linux-x86_64 for Linux
- colortest-macos-x86_64 for macOS
- colortest-windows.exe for Windows
-
Run the downloaded binary directly from your terminal.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions, bug reports, and suggestions are welcome. Feel free to open an issue or submit a pull request.