Skip to content

Commit

Permalink
chore: readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Mostik authored Feb 13, 2024
1 parent 18b8b79 commit 6d5348a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,24 @@ pub fn main() !void {
```
## ANSI Colors
![image](https://github.com/Mostik/terminal/assets/51542168/97cdda8c-390d-45a7-a5c4-eeea0233f4d4)
```zig
const std = @import("std");
const Color = @import("terminal").Color;
pub fn main() !void {
const mystring = std.fmt.comptimePrint("{s} My text {s}", .{
Color(null).underline(),
Color(null).default(),
});
std.debug.print("{s}\n", .{mystring});
std.debug.print("{s}{s}\n", .{ Color(.fg).bit(3), "0-7" });
std.debug.print("{s}{s}\n", .{ Color(.fg).byte(213), "0-255" });
std.debug.print("{s}{s}\n", .{ Color(.fg).rgb(255, 255, 255), "rgb" });
std.debug.print("{s}{s}\n", .{ Color(.fg).hex(0xab23f2), "hex" });
std.debug.print("{s}{s}\n", .{ Color(.fg).enm(.red), "Colors.0-7" });
}
```
## Terminal Size
```zig
std.debug.print("{any}", .{terminal.size()});
Expand Down

0 comments on commit 6d5348a

Please sign in to comment.