https://github.com/terroo/hexter
Get the syntax of a hexadecimal color for the terminal (ANSI RGB)
https://github.com/terroo/hexter
ansi ansi-colors cli command-line cpp cpp20 hexadecimal rgb
Last synced: 2 months ago
JSON representation
Get the syntax of a hexadecimal color for the terminal (ANSI RGB)
- Host: GitHub
- URL: https://github.com/terroo/hexter
- Owner: terroo
- License: gpl-3.0
- Created: 2025-07-01T14:30:05.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-07-01T22:41:45.000Z (3 months ago)
- Last Synced: 2025-07-16T03:01:04.838Z (3 months ago)
- Topics: ansi, ansi-colors, cli, command-line, cpp, cpp20, hexadecimal, rgb
- Language: C++
- Homepage: https://github.com/terroo/hexter
- Size: 83 KB
- Stars: 5
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🎨 `hexter`
> Get the syntax of a hexadecimal color for the terminal (ANSI RGB)
---
## 📦 Dependencies
+ C++ Compiler: [GCC](https://gcc.gnu.org/) or [Clang](https://clang.llvm.org/)
+ [CMake](https://cmake.org/)---
## 🚧 Build and Install
### Windows
Install Dependencies:
+ [Git](https://winstall.app/apps/Git.Git): `winget install --id=Git.Git -e`
+ [GCC](https://terminalroot.com/how-to-install-the-new-version-of-gcc-mingw-on-windows/) → *Click on the link to see the procedure*
+ [CMake](https://winstall.app/apps/Kitware.CMake): `winget install --id=Kitware.CMake -e`Open [PowerShell](https://terminalroot.com/customize-your-powershell-like-a-pro/) with **administrator permission**:
> `Start-Process powershell -Verb runAs````bash
git clone https://github.com/terroo/hexter
cd hexter
cmake . -G "Unix Makefiles" -B build -DCMAKE_INSTALL_PREFIX="C:/Program Files/HexTer"
cmake --build build
cmake --install build
[System.Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\HexTer\bin", [System.EnvironmentVariableTarget]::Machine)
```
> Close the terminal and open it again and test: `hexter fd6389`
### Unix-like(macOS, GNU/Linux, BSD and Haiku)
```bash
git clone https://github.com/terroo/hexter
cd hexter
cmake . -B build
cmake --build build
sudo cmake --install build
```---
## 💼 Usage and Examples
```bash
hexter '#a6e22e' # Use quotes or double quotes for '#'
hexter fd6389 # No quotes
```---
## 🔠Use API
```cpp
#include
#include "hexter-color.hpp"int main(){
std::println("{}Hello, World!{}", hexter::color("#84afd7"), hexter::off);
}
```If you want to install the API:
```bash
sudo wget -q \
https://raw.githubusercontent.com/terroo/hexter/refs/heads/main/hexter-color.hpp \
-O /usr/local/include/hexter-color.hpp
```
> And just include: `#include `> **`hexter`** is still in early versions, if you find any *bugs*, please open an [issue](https://github.com/terroo/hexter/issues).