| ... | ... | @@ -70,7 +70,12 @@ pub const Config = union(enum) { |
| 70 | 70 | reset_attributes: u16, |
| 71 | 71 | }; |
| 72 | 72 | |
| 73 | | pub fn setColor(conf: Config, out_stream: anytype, color: Color) !void { |
| 73 | pub fn setColor( |
| 74 | conf: Config, |
| 75 | writer: anytype, |
| 76 | color: Color, |
| 77 | ) (@typeInfo(@TypeOf(writer.writeAll(""))).ErrorUnion.error_set || |
| 78 | windows.SetConsoleTextAttributeError)!void { |
| 74 | 79 | nosuspend switch (conf) { |
| 75 | 80 | .no_color => return, |
| 76 | 81 | .escape_codes => { |
| ... | ... | @@ -95,7 +100,7 @@ pub const Config = union(enum) { |
| 95 | 100 | .dim => "\x1b[2m", |
| 96 | 101 | .reset => "\x1b[0m", |
| 97 | 102 | }; |
| 98 | | try out_stream.writeAll(color_string); |
| 103 | try writer.writeAll(color_string); |
| 99 | 104 | }, |
| 100 | 105 | .windows_api => |ctx| if (native_os == .windows) { |
| 101 | 106 | const attributes = switch (color) { |