diff --git a/src/terminal/kitty/color.zig b/src/terminal/kitty/color.zig index 6b797e733..91dc3dadf 100644 --- a/src/terminal/kitty/color.zig +++ b/src/terminal/kitty/color.zig @@ -56,12 +56,9 @@ pub const Kind = union(enum) { _ = layout; _ = opts; - // Format as a number if its a palette color otherwise - // format as a string. - if (self == .palette) { - try writer.print("{d}", .{self.palette}); - } else { - try writer.print("{s}", .{@tagName(self.special)}); + switch (self) { + .palette => |p| try writer.print("{d}", .{p}), + .special => |s| try writer.print("{s}", .{@tagName(s)}), } } };