add cell, character, style, color primitives
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
This commit is contained in:
parent
3176eb81ef
commit
3783bcad10
1 changed files with 33 additions and 0 deletions
33
src/cell.zig
Normal file
33
src/cell.zig
Normal file
|
@ -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,
|
||||||
|
};
|
Loading…
Reference in a new issue