From 3783bcad1099dd6a0686a3dc8d2dc6b812b5fcfb Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Thu, 18 Jan 2024 21:02:17 -0600 Subject: [PATCH] add cell, character, style, color primitives Signed-off-by: Tim Culverhouse --- src/cell.zig | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/cell.zig diff --git a/src/cell.zig b/src/cell.zig new file mode 100644 index 0000000..db94358 --- /dev/null +++ b/src/cell.zig @@ -0,0 +1,33 @@ +pub const Cell = struct { + char: Character, + style: Style = .{}, +}; + +pub const Character = struct { + grapheme: []const u8, + width: usize, +}; + +pub const Style = struct { + fg: Color = .default, + bg: Color = .default, + ul: Color = .default, + ul_style: UnderlineStyle = .off, + url: ?[]const u8 = null, + url_params: ?[]const u8 = null, +}; + +pub const Color = union(enum) { + default, + index: u8, + rgb: [3]u8, +}; + +pub const UnderlineStyle = enum { + off, + single, + double, + curly, + dotted, + dashed, +};