From 827eca7e61f4d8f179b3165f5ddd74b92adab54d Mon Sep 17 00:00:00 2001 From: Armin Date: Mon, 13 Jul 2026 22:40:43 +0200 Subject: [PATCH] Piano keys: add subtle vertical gradient for 3D appearance --- Source/PluginEditor.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 6f39fe0..5261cb0 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -838,10 +838,13 @@ void PianoRollComponent::paint(juce::Graphics& g) { auto rect = juce::Rectangle(kx, 0, whiteKeyWidth - 1, whiteKeyHeight); bool pressed = processor.isNoteActive(note); - if (pressed) + if (pressed) { g.setColour(juce::Colour(0xffccaa44)); - else - g.setColour(juce::Colour(0xffdddddd)); + } else { + juce::ColourGradient grad(juce::Colour(0xffe4e4e4), static_cast(kx), 0.0f, + juce::Colour(0xffc8c8c8), static_cast(kx), static_cast(whiteKeyHeight), false); + g.setGradientFill(grad); + } g.fillRect(rect); g.setColour(juce::Colour(0xff555555)); @@ -872,10 +875,13 @@ void PianoRollComponent::paint(juce::Graphics& g) { auto rect = juce::Rectangle(static_cast(bx), 0, blackKeyWidth, blackKeyHeight); bool pressed = processor.isNoteActive(note); - if (pressed) + if (pressed) { g.setColour(juce::Colour(0xffccaa44)); - else - g.setColour(juce::Colour(0xff333333)); + } else { + juce::ColourGradient grad(juce::Colour(0xff444444), static_cast(bx), 0.0f, + juce::Colour(0xff222222), static_cast(bx), static_cast(blackKeyHeight), false); + g.setGradientFill(grad); + } g.fillRect(rect); g.setColour(juce::Colour(0xff555555));