The configuration of the `Container` types is very much inspired by [clay](https://github.com/nicbarker/clay).
21 lines
485 B
Zig
21 lines
485 B
Zig
const std = @import("std");
|
|
const Style = @import("style.zig");
|
|
|
|
pub const Cell = @This();
|
|
|
|
style: Style = .{},
|
|
rune: u8 = ' ',
|
|
|
|
pub fn eql(this: Cell, other: Cell) bool {
|
|
return this.rune == other.rune and this.style.eql(other.style);
|
|
}
|
|
|
|
pub fn reset(this: *Cell) void {
|
|
this.style = .{ .fg = .default, .bg = .default, .ul = .default, .ul_style = .off };
|
|
this.rune = ' ';
|
|
}
|
|
|
|
pub fn value(this: Cell, writer: anytype) !void {
|
|
try this.style.value(writer, this.rune);
|
|
}
|