diff --git a/build.zig b/build.zig index 053e9ed..a06035e 100644 --- a/build.zig +++ b/build.zig @@ -21,6 +21,7 @@ pub fn build(b: *std.Build) void { }), .name = "pretty-example", }); + b.installArtifact(example); const run_example = b.addRunArtifact(example); run_example.step.dependOn(b.getInstallStep()); diff --git a/pretty.zig b/pretty.zig index 5a05f0c..ce894bc 100644 --- a/pretty.zig +++ b/pretty.zig @@ -38,17 +38,9 @@ pub const Theme = struct { color_true: Io.Terminal.Color = .bright_green, color_false: Io.Terminal.Color = .bright_red, - pub fn getColor(this: Theme, option: Colors) Io.Terminal.Color { - return switch (option) { - // .dim => this.color_dim, - // .field => this.color_field, - // .value => this.color_value, - // .@"error" => this.color_error, - // .type => this.color_type, - // .null => this.color_null, - // .true => this.color_true, - // .false => this.color_false, - inline else => |opt| @field(this, "color_" ++ @tagName(opt)), + pub fn getColor(this: Theme, color: Colors) Io.Terminal.Color { + return switch (color) { + inline else => |col| @field(this, "color_" ++ @tagName(col)), }; } };