Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tr1ckydev/chameleon
🦎 Terminal string styling for zig.
https://github.com/tr1ckydev/chameleon
terminal terminal-styling zig zig-package
Last synced: 19 days ago
JSON representation
🦎 Terminal string styling for zig.
- Host: GitHub
- URL: https://github.com/tr1ckydev/chameleon
- Owner: tr1ckydev
- License: mit
- Created: 2023-10-04T11:51:56.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-15T15:38:16.000Z (about 2 months ago)
- Last Synced: 2024-11-15T16:35:11.399Z (about 2 months ago)
- Topics: terminal, terminal-styling, zig, zig-package
- Language: Zig
- Homepage:
- Size: 999 KB
- Stars: 82
- Watchers: 4
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![](./res/banner.png)
# chameleon
🦎 Terminal string styling for zig.
*Currently the only fully featured terminal color solution for zig. âš¡*
- Expressive API
- Highly performant
- Ability to nest styles
- Ability for custom themes
- No dependencies
- Clean and focused
- Truecolor support
- 140+ built in color presets![](./res/showcase.png)
## Installation
- Install the package.
```bash
zig fetch --save git+https://github.com/tr1ckydev/chameleon
```- Add the package in `build.zig`.
```zig
const cham = b.dependency("chameleon", .{});
exe.root_module.addImport("chameleon", cham.module("chameleon"));
```- Import it in your project.
```zig
const Chameleon = @import("chameleon");
```## Usage
Chameleon is divided into two APIs — **Comptime** and **Runtime**.
- **Comptime:** The comptime API is simplest way to implement colors in your terminal.
- **Runtime:** The runtime API is much more flexible and is the recommended way when building for production.At the end, choose what fits best for your use case.
## Documentation
Check out the full documentation [here](https://github.com/tr1ckydev/chameleon/blob/main/DOCUMENTATION.md).
## `NO_COLOR` support
> According to [no-color.org](https://no-color.org/), *"Command-line software which adds ANSI color to its output by default should check for a `NO_COLOR` environment variable that, when present and not an empty string (regardless of its value), prevents the addition of ANSI color."*
>Chameleon supports this standard only in it's **Runtime API** by detecting the presence of the *NO_COLOR* environment variable (regardless of it's value), if present disables any ANSI colors or styles, and can also be configured to not do so if you want to implement a different way of detection, although highly not recommended.
## License
This repository uses the MIT License. Check [LICENSE](https://github.com/tr1ckydev/chameleon/blob/main/LICENSE) for full license text.