From b576c238fb0e3da3ac8d22baf3f29245a5a6f2bc Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 2 Aug 2026 23:48:38 -0300 Subject: add colorscheme-aware PDF tint modes --- src/builtins.zig | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/builtins.zig') diff --git a/src/builtins.zig b/src/builtins.zig index b89952cd..4f6db6e1 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -190,7 +190,7 @@ pub const Colors = struct { /// clicks was never what made it useful. pub const NextColor = struct { pub fn run(c: Ctx) void { - c.p.theme_idx = (c.p.theme_idx + 1) % pardes.themes.len; + c.p.setThemeIndex((c.p.theme_idx + 1) % pardes.themes.len); } }; @@ -209,7 +209,7 @@ pub const Theme = struct { const want = std.mem.trim(u8, c.arg orelse return, " \t\r\n"); for (pardes.themes, 0..) |t, i| { if (std.mem.eql(u8, t.name, want)) { - c.p.theme_idx = i; + c.p.setThemeIndex(i); return; } } @@ -301,6 +301,16 @@ pub const PdfFit = struct { } }; +/// Cycle a native PDF through original pixels, a chroma-preserving themed +/// filter, and a full theme duotone. It has the same compile-time and +/// pane-local shape as PdfFit: absent without MuPDF and inert off a PDF pane. +pub const PdfTint = struct { + pub const run = if (pardes.pdf_enabled) apply else {}; + fn apply(c: Ctx) void { + c.p.togglePdfTint(c.pane); + } +}; + // The image pane's three renderer toggles. They used to be words the image tag // printed and the execute dispatcher matched by hand; as builtins they are // executable anywhere, pressable under SPC and listed by `SPC ?`, the whole -- cgit v1.3