color: export Color and fix bright indexing

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
This commit is contained in:
Tim Culverhouse 2024-02-02 16:22:26 -06:00
parent 2b8346f691
commit eae1036c29
2 changed files with 3 additions and 2 deletions

View file

@ -5,6 +5,7 @@ const cell = @import("cell.zig");
pub const Cell = cell.Cell; pub const Cell = cell.Cell;
pub const Style = cell.Style; pub const Style = cell.Style;
pub const Segment = cell.Segment; pub const Segment = cell.Segment;
pub const Color = cell.Color;
pub const Key = @import("Key.zig"); pub const Key = @import("Key.zig");
pub const Mouse = @import("Mouse.zig"); pub const Mouse = @import("Mouse.zig");

View file

@ -359,7 +359,7 @@ pub fn Vaxis(comptime T: type) type {
.index => |idx| { .index => |idx| {
switch (idx) { switch (idx) {
0...7 => try std.fmt.format(writer, ctlseqs.fg_base, .{idx}), 0...7 => try std.fmt.format(writer, ctlseqs.fg_base, .{idx}),
8...15 => try std.fmt.format(writer, ctlseqs.fg_bright, .{idx}), 8...15 => try std.fmt.format(writer, ctlseqs.fg_bright, .{idx - 8}),
else => try std.fmt.format(writer, ctlseqs.fg_indexed, .{idx}), else => try std.fmt.format(writer, ctlseqs.fg_indexed, .{idx}),
} }
}, },
@ -376,7 +376,7 @@ pub fn Vaxis(comptime T: type) type {
.index => |idx| { .index => |idx| {
switch (idx) { switch (idx) {
0...7 => try std.fmt.format(writer, ctlseqs.bg_base, .{idx}), 0...7 => try std.fmt.format(writer, ctlseqs.bg_base, .{idx}),
8...15 => try std.fmt.format(writer, ctlseqs.bg_bright, .{idx}), 8...15 => try std.fmt.format(writer, ctlseqs.bg_bright, .{idx - 8}),
else => try std.fmt.format(writer, ctlseqs.bg_indexed, .{idx}), else => try std.fmt.format(writer, ctlseqs.bg_indexed, .{idx}),
} }
}, },