mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-21 19:26:09 +03:00
cli: list-colors uses new generated rgb
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const inputpkg = @import("../input.zig");
|
const inputpkg = @import("../input.zig");
|
||||||
const args = @import("args.zig");
|
const args = @import("args.zig");
|
||||||
const RGBName = @import("rgb_names").RGBName;
|
const x11_color = @import("../terminal/main.zig").x11_color;
|
||||||
|
|
||||||
pub const Options = struct {
|
pub const Options = struct {
|
||||||
pub fn deinit(self: Options) void {
|
pub fn deinit(self: Options) void {
|
||||||
@ -23,9 +23,10 @@ pub fn run(alloc: std.mem.Allocator) !u8 {
|
|||||||
|
|
||||||
const stdout = std.io.getStdOut().writer();
|
const stdout = std.io.getStdOut().writer();
|
||||||
|
|
||||||
inline for (std.meta.fields(RGBName)) |f| {
|
inline for (x11_color.map.kvs) |kv| {
|
||||||
const rgb = @field(RGBName, f.name).toRGB();
|
const name = kv.key;
|
||||||
try stdout.print("{s} = #{x:0>2}{x:0>2}{x:0>2}\n", .{ f.name, rgb.r, rgb.g, rgb.b });
|
const rgb = kv.value;
|
||||||
|
try stdout.print("{s} = #{x:0>2}{x:0>2}{x:0>2}\n", .{ name, rgb.r, rgb.g, rgb.b });
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user