diff options
Diffstat (limited to 'core/jj.zig')
| -rw-r--r-- | core/jj.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/jj.zig b/core/jj.zig index 696bd659..63488b8c 100644 --- a/core/jj.zig +++ b/core/jj.zig @@ -2255,7 +2255,7 @@ pub const Inks = struct { added: [3]u8, taken: [3]u8 }; /// The diff's own two colours: the theme's green and its red (the grounds' /// and the changed words' hues), each pushed toward the ink until it reads /// 3:1 on the page (or nearly as the ink does, where the ink reads less). -pub fn laneInks(th: *const pardes.Theme) Inks { +pub fn laneInks(th: *const pardes.LegacyTheme) Inks { var inks: [2][3]u8 = .{ if (th.palette) |c| c[2] else .{ 0x2e, 0xa0, 0x43 }, themeRed(th) }; const page = th.bg orelse th.tag_bg; for (&inks) |*ink| { @@ -2270,7 +2270,7 @@ pub fn laneInks(th: *const pardes.Theme) Inks { /// and red), in hue order from the top, each a hue `hue_apart` or more from /// the one kept before it (doom one: magenta, blue, yellow; cyan and /// orange go). Distinct colours, never one between two. -pub fn laneColours(th: *const pardes.Theme, buf: *[8][3]u8) []const [3]u8 { +pub fn laneColours(th: *const pardes.LegacyTheme, buf: *[8][3]u8) []const [3]u8 { const pal = th.palette; const grounds = [2][3]u8{ themeRed(th), if (pal) |c| c[2] else .{ 0x2e, 0xa0, 0x43 } }; const accents: [6][3]u8 = if (pal) |c| .{ c[3], c[4], c[5], c[6], th.num, th.kw } else .{ th.kw, th.num, th.str, th.box, th.column_box orelse th.box, th.comment }; @@ -2334,14 +2334,14 @@ pub fn paint(p: *Pardes, s: *pardes.Surface, pane: *Pane, r: pardes.Rect, tx: u1 } /// The theme's red: what a change took away; churn's top. -pub fn themeRed(th: *const pardes.Theme) [3]u8 { +pub fn themeRed(th: *const pardes.LegacyTheme) [3]u8 { return if (th.palette) |c| c[1] else .{ 0xcf, 0x22, 0x2e }; } /// A count's colour on churn's gradient: smooth from the line numbers' /// grey to the theme's red, on a log scale of the count against the /// hottest; null for none. -fn heatColour(th: *const pardes.Theme, count: u16, hottest: u16) ?[3]u8 { +fn heatColour(th: *const pardes.LegacyTheme, count: u16, hottest: u16) ?[3]u8 { if (count == 0 or hottest == 0) return null; const t = @log(@as(f32, @floatFromInt(count)) + 1) / @log(@as(f32, @floatFromInt(hottest)) + 1); return pardes.colors.mixOklab(th.lineno, themeRed(th), t); @@ -2918,7 +2918,7 @@ test "Changes draws a lane a pinned change after the line number, nested ones a } test "a diff's two lane inks in every theme: its green and its red, never one colour, each read on the page" { - for (&pardes.colors.themes) |*th| { + for (&pardes.colors.legacy_themes) |*th| { const inks = laneInks(th); errdefer std.debug.print("{s}: added {any} taken {any}\n", .{ th.name, inks.added, inks.taken }); try testing.expect(!std.meta.eql(inks.added, inks.taken)); |
