From 07d89aa54a6a57f0136a96ac95250cf95e808537 Mon Sep 17 00:00:00 2001 From: Patrick Schaper Date: Thu, 21 May 2026 15:19:28 +0200 Subject: [PATCH] feat: add two darker brightness steps to rain palette - insert RGB(0,32,0) and RGB(0,63,0) between black and the first xterm dim green (95) - bridges the xterm-256 cube gap for a more gradual fade trail at the dim end - palette grows from 11 to 13 levels Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Sources/MatrixScreenSaver/NativeMatrixRenderer.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Sources/MatrixScreenSaver/NativeMatrixRenderer.swift b/Sources/MatrixScreenSaver/NativeMatrixRenderer.swift index 42bde79..b666aad 100644 --- a/Sources/MatrixScreenSaver/NativeMatrixRenderer.swift +++ b/Sources/MatrixScreenSaver/NativeMatrixRenderer.swift @@ -1160,6 +1160,10 @@ final class NativeMatrixRenderer { } /// Builds the green palette used for foreground and diffuse rendering levels. + /// + /// The xterm-256 color cube has no green values between 0 and 95, so two + /// extra dark steps (≈32 and ≈63) are inserted directly after black to + /// bridge that gap and provide a smoother fade trail at the dim end. private static func makePalette() -> [TerminalColor] { let base = index2color(47) @@ -1204,6 +1208,11 @@ final class NativeMatrixRenderer { indices.append(grayStart - 1) } - return indices.map(index2color) + var result = indices.map(index2color) + // Insert two darker steps between black (index 0) and the first xterm + // dim green (≈95), dividing the gap into thirds for a gradual fade-in. + result.insert(TerminalColor(red: 0, green: 63, blue: 0), at: 1) + result.insert(TerminalColor(red: 0, green: 32, blue: 0), at: 1) + return result } }