diff options
Diffstat (limited to 'src/Art.zig')
| -rw-r--r-- | src/Art.zig | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/src/Art.zig b/src/Art.zig index 6cc33e2e..2e2941c6 100644 --- a/src/Art.zig +++ b/src/Art.zig @@ -6,7 +6,7 @@ //! the same on every client. One of these a frontend keeps the art of the //! pictures it shows, while it shows them. const std = @import("std"); -const ghostty_vt = @import("ghostty-vt"); +const colors = @import("colors.zig"); const pardes = @import("pardes.zig"); const Art = @This(); @@ -76,7 +76,7 @@ fn gridOf(art: *Art, gpa: std.mem.Allocator, place: Placement, cell_h: u32) ?Gri } const colours = switch (place.art.palette) { .commodore => commodore, - .terminal => terminal_palette, + .terminal => colors.xterm[0..16].*, }; const grid = (if (place.at == null) fitted(gpa, place.raster, place.src, place.dst.w, place.dst.h, colours, place.art.ascii) @@ -466,34 +466,6 @@ fn renderRect(gpa: std.mem.Allocator, raster: Raster, src: RectPx, cols: usize, return .{ .cells = cells, .cols = cols, .rows = rows }; } -pub const terminal_palette = [16][3]u8{ - .{ 0x1D, 0x1F, 0x21 }, // black - .{ 0xCC, 0x66, 0x66 }, // red - .{ 0xB5, 0xBD, 0x68 }, // green - .{ 0xF0, 0xC6, 0x74 }, // yellow - .{ 0x81, 0xA2, 0xBE }, // blue - .{ 0xB2, 0x94, 0xBB }, // magenta - .{ 0x8A, 0xBE, 0xB7 }, // cyan - .{ 0xC5, 0xC8, 0xC6 }, // white - .{ 0x66, 0x66, 0x66 }, // bright black - .{ 0xD5, 0x4E, 0x53 }, // bright red - .{ 0xB9, 0xCA, 0x4A }, // bright green - .{ 0xE7, 0xC5, 0x47 }, // bright yellow - .{ 0x7A, 0xA6, 0xDA }, // bright blue - .{ 0xC3, 0x97, 0xD8 }, // bright magenta - .{ 0x70, 0xC0, 0xB1 }, // bright cyan - .{ 0xEA, 0xEA, 0xEA }, // bright white -}; - -comptime { - for (terminal_palette, 0..) |rgb, i| { - const c = ghostty_vt.color.default[i]; - if (rgb[0] != c.r or rgb[1] != c.g or rgb[2] != c.b) @compileError( - "terminal palette differs from the emulator", - ); - } -} - test "sextant codepoints: blocks + endpoints" { try std.testing.expectEqual(@as(u21, ' '), sextantCp(0)); try std.testing.expectEqual(@as(u21, 0x2588), sextantCp(63)); |
