From eae1036c2920a5d6fcc8188ec9248e2ca8e9d3ce Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Fri, 2 Feb 2024 16:22:26 -0600 Subject: [PATCH] color: export Color and fix bright indexing Signed-off-by: Tim Culverhouse --- src/main.zig | 1 + src/vaxis.zig | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.zig b/src/main.zig index 0263433..308fd2b 100644 --- a/src/main.zig +++ b/src/main.zig @@ -5,6 +5,7 @@ const cell = @import("cell.zig"); pub const Cell = cell.Cell; pub const Style = cell.Style; pub const Segment = cell.Segment; +pub const Color = cell.Color; pub const Key = @import("Key.zig"); pub const Mouse = @import("Mouse.zig"); diff --git a/src/vaxis.zig b/src/vaxis.zig index 95ef9fd..1142e3f 100644 --- a/src/vaxis.zig +++ b/src/vaxis.zig @@ -359,7 +359,7 @@ pub fn Vaxis(comptime T: type) type { .index => |idx| { switch (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}), } }, @@ -376,7 +376,7 @@ pub fn Vaxis(comptime T: type) type { .index => |idx| { switch (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}), } },