╭ changed ────────╮ │src/ui/widget.zig│ ╰─────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │1822 } │ │1823 }.f; │ │1824 return .{ .rgb = .{ .r = snap(v.r), .g = snap(v.g), .b = snap(v.b) } };│ │1825 - } │ │1826 - │ │1827 - fn applyArtBackground(dst: *Grid.Cell, src: Grid.Cell) void { │ │1828 - const background_maybe = sgrSafe(src.style.bg orelse src.style.fg); │ │1829 - dst.style.bg = background_maybe; │ │1830 - // change unstyled text to contrast with the art behind it │ │1831 - if (dst.style.fg == null) { │ │1832 - if (artRgb(background_maybe)) |v| { │ │1833 - // use near-black and near-white, which is easier on the eyes │ │1834 - // while retaining high contrast │ │1835 - const luminance = (@as(u32, v.r) * 299 + │ │1836 - @as(u32, v.g) * 587 + │ │1837 - @as(u32, v.b) * 114) / 1000; │ │1838 - dst.style.fg = if (luminance >= 128) │ │1839 - .{ .rgb = .{ .r = 16, .g = 16, .b = 16 } } │ │1840 - else │ │1841 - .{ .rgb = .{ .r = 240, .g = 240, .b = 240 } }; │ │1842 - } │ │1843 - } │ │1825 } │ │1826 │ │1827 // composites ANSI art behind a foreground grid │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │1844 dst.style.bg = sgrSafe(dst.style.bg); │ │1845 try out.setRune(anchor_x + x, y, src.rune); │ │1846 } else { │ │1866 - applyArtBackground(dst, src); │ │1867 - if (next_dst) |next| applyArtBackground(next, src); │ │1847 + const art_bg = sgrSafe(src.style.bg orelse src.style.fg);│ │1848 + dst.style.bg = art_bg; │ │1849 + if (next_dst) |next| next.style.bg = art_bg; │ │1850 } │ │1851 } │ │1852 } │ ╰───────────────────────────────────────────────────────────────────────────────────╯