diff options
Diffstat (limited to 'src/colors.zig')
| -rw-r--r-- | src/colors.zig | 67 |
1 files changed, 2 insertions, 65 deletions
diff --git a/src/colors.zig b/src/colors.zig index 90ed7b76..aec2917f 100644 --- a/src/colors.zig +++ b/src/colors.zig @@ -110,7 +110,7 @@ test "every native theme's separators stand off its page, and its focus tint off } test "every faithful port meets pardes's chrome floors in its own colours, with nothing left to derive" { - const first = comptime indexOfTheme("lapis_plain") + 1; + const first = comptime indexOfTheme("lapis") + 1; const last = comptime indexOfTheme("helix"); for (themes[first..last]) |*th| { const chrome = ChromeTheme.fromTheme(th); @@ -277,42 +277,6 @@ pub fn mix(a: [3]u8, b: [3]u8) [3]u8 { return out; } -/// A theme's ornament, drawn by a pixel shell inside the chrome it already -/// has (docs/render-pipeline.md ยง10: no gaps between panes): the lapis -/// theme's. Sizes are logical pixels. None of it touches a focus indicator: -/// the dots lie on the page's own ground, the checker in the scroll track -/// (never its thumb), a tag's plaque inside its band beside its grip (and -/// the focused one only the more striking), and the shadow under a file -/// name's own letters. -pub const Decor = struct { - /// A dot grid on the page's ground, `page_dot_alpha` of 255 strong, a - /// dot one logical pixel across (fading out by a pixel and a half) every - /// `page_dot_px`, fixed to the window. - page_dots: ?[3]u8 = null, - page_dot_alpha: u8 = 0x22, - page_dot_px: u8 = 22, - /// A checker in the scroll track, squares of `rail_checker_px`, this - /// colour and the track's. - rail_checker: ?[3]u8 = null, - rail_checker_px: u8 = 3, - /// Every tag drawn as a raised plaque inside its own band (the site's - /// trail and title bars): a `tag_border` frame round the text, a hard - /// `tag_shadow` offset down and right by `tag_shadow_px`, both within - /// the band's rows and columns, never past them; the focused pane's - /// plaque striped `tag_stripe` and the tag's ground, `tag_stripe_px` - /// each, its words on plates of the ground. Column and workspace tags - /// take a quieter one (a one-pixel frame, a shadow of two, no stripes). - tag_border: ?[3]u8 = null, - tag_border_px: u8 = 2, - tag_shadow: ?[3]u8 = null, - tag_shadow_px: u8 = 5, - tag_stripe: ?[3]u8 = null, - tag_stripe_px: u8 = 2, - /// The file name's offset shadow, down and right, in a pane's tag. - title_shadow: ?[3]u8 = null, - title_shadow_px: u8 = 2, -}; - pub const Theme = struct { name: []const u8, bg: ?[3]u8, @@ -378,8 +342,6 @@ pub const Theme = struct { /// in pixels at a 17px tagline, the thumb one narrower (acme's 12px /// Scrollwid, the default). rail_px: ?u8 = null, - /// A pixel shell's ornament (Decor): lapis's. - decor: ?Decor = null, }; /// One family, its twelve backgrounds a theme each (`curated`). @@ -403,7 +365,6 @@ const curated = struct { pub const orchard_black = @import("themes/orchard_black.zig"); pub const acme = @import("themes/acme.zig"); pub const lapis = @import("themes/lapis.zig"); - pub const lapis_plain = @import("themes/lapis_plain.zig"); // Faithful ports of well-known themes, a family at a time (src/themes/ // <name>.zig says where each value came from): `theme_groups`. pub const dark_plus = @import("themes/dark_plus.zig"); @@ -483,15 +444,7 @@ fn fold(comptime C: type) [@typeInfo(C).@"struct".decl_names.len]Theme { var t: Theme = undefined; const source = @field(C, d).theme; for (theme_info.field_names, theme_info.field_types, theme_info.field_attrs) |name, T, attrs| { - @field(t, name) = if (T == ?Decor and @hasField(@TypeOf(source), name)) decor: { - // A nested literal is folded field by field too. - var decor: Decor = .{}; - const given = @field(source, name); - for (@typeInfo(Decor).@"struct".field_names) |g| if (@hasField(@TypeOf(given), g)) { - @field(decor, g) = @field(given, g); - }; - break :decor decor; - } else if (@hasField(@TypeOf(source), name)) + @field(t, name) = if (@hasField(@TypeOf(source), name)) @field(source, name) else if (attrs.defaultValue(T)) |value| value @@ -573,22 +526,6 @@ test "seoul256's twelve backgrounds ring in their order, after Catppuccin and be try std.testing.expectEqualStrings("zenbones_light", themes[first + names.len].name); } -test "lapis_plain is lapis on flat grounds, framed and shadowed as lapis" { - const lapis = themes[indexOfTheme("lapis")]; - const plain = themes[indexOfTheme("lapis_plain")]; - try std.testing.expectEqual(indexOfTheme("lapis") + 1, indexOfTheme("lapis_plain")); - var same = plain; - same.name = lapis.name; - same.decor = lapis.decor; - try std.testing.expectEqualDeep(lapis, same); - const decor = plain.decor.?; - try std.testing.expect(decor.page_dots == null and decor.tag_stripe == null); - try std.testing.expectEqualDeep(lapis.decor.?.tag_border, decor.tag_border); - try std.testing.expectEqualDeep(lapis.decor.?.tag_shadow, decor.tag_shadow); - try std.testing.expectEqualDeep(lapis.decor.?.title_shadow, decor.title_shadow); - try std.testing.expectEqualDeep(lapis.decor.?.rail_checker, decor.rail_checker); -} - /// Original and classic-inspired Pardes palettes precede retained imports. pub const native_theme_count = 15; |
