https://github.com/dayvster/tintz
Minimal Zig library for coloring and styling terminal output with ANSI escape codes.
https://github.com/dayvster/tintz
terminal zig zig-library zig-package ziglang
Last synced: 2 months ago
JSON representation
Minimal Zig library for coloring and styling terminal output with ANSI escape codes.
- Host: GitHub
- URL: https://github.com/dayvster/tintz
- Owner: dayvster
- License: mit
- Created: 2025-10-01T19:15:19.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-10-01T19:36:28.000Z (9 months ago)
- Last Synced: 2025-10-01T21:24:31.579Z (9 months ago)
- Topics: terminal, zig, zig-library, zig-package, ziglang
- Language: Zig
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tintz
Minimal Zig library for coloring and styling terminal output with ANSI escape codes.
[](./LICENSE)
[](https://ziglang.org/)
[]()
## Install
Installation
Fetch the package with Zig:
```sh
zig fetch --save git+https://github.com/dayvster/tintz
```
Then add it as a module in your build.zig:
```zig
const tintz_mod = b.addModule("tintz", .{
.root_source_file = b.path("src/root.zig"),
.target = target,
});
```
Then import the module in your Zig code:
```zig
const tintz = @import("tintz");
```
## Features
- Foreground and background colors (8-bit and truecolor/hex)
- Bold and italic text
- Combine multiple styles
- Simple API for generating styled output
- No dependencies
## Usage
Add `src/tintz.zig` to your Zig project and import via your build system or module path.
```zig
const tintz = @import("tintz");
var buf: [128]u8 = undefined;
const styled = try tintz.tintz(
tintz.Style{ .fg = tintz.Color.red, .bold = true },
"Hello, world!",
&buf,
);
try std.fs.File.stdout().writeAll(styled);
```
See `examples/basic.zig` for more usage patterns and style combinations.
## Why tintz?
- Works with Zig 0.15+
- Handles buffer safety and error reporting
- Designed for robust output in modern terminals
- Easy to extend for more styles
## License
MIT