mirror of
https://codeberg.org/armin/chromaflock.git
synced 2026-09-01 04:10:47 +02:00
Piano keys: add subtle vertical gradient for 3D appearance
This commit is contained in:
parent
0180e0771d
commit
827eca7e61
1 changed files with 12 additions and 6 deletions
|
|
@ -838,10 +838,13 @@ void PianoRollComponent::paint(juce::Graphics& g) {
|
||||||
auto rect = juce::Rectangle<int>(kx, 0, whiteKeyWidth - 1, whiteKeyHeight);
|
auto rect = juce::Rectangle<int>(kx, 0, whiteKeyWidth - 1, whiteKeyHeight);
|
||||||
|
|
||||||
bool pressed = processor.isNoteActive(note);
|
bool pressed = processor.isNoteActive(note);
|
||||||
if (pressed)
|
if (pressed) {
|
||||||
g.setColour(juce::Colour(0xffccaa44));
|
g.setColour(juce::Colour(0xffccaa44));
|
||||||
else
|
} else {
|
||||||
g.setColour(juce::Colour(0xffdddddd));
|
juce::ColourGradient grad(juce::Colour(0xffe4e4e4), static_cast<float>(kx), 0.0f,
|
||||||
|
juce::Colour(0xffc8c8c8), static_cast<float>(kx), static_cast<float>(whiteKeyHeight), false);
|
||||||
|
g.setGradientFill(grad);
|
||||||
|
}
|
||||||
g.fillRect(rect);
|
g.fillRect(rect);
|
||||||
|
|
||||||
g.setColour(juce::Colour(0xff555555));
|
g.setColour(juce::Colour(0xff555555));
|
||||||
|
|
@ -872,10 +875,13 @@ void PianoRollComponent::paint(juce::Graphics& g) {
|
||||||
auto rect = juce::Rectangle<int>(static_cast<int>(bx), 0, blackKeyWidth, blackKeyHeight);
|
auto rect = juce::Rectangle<int>(static_cast<int>(bx), 0, blackKeyWidth, blackKeyHeight);
|
||||||
|
|
||||||
bool pressed = processor.isNoteActive(note);
|
bool pressed = processor.isNoteActive(note);
|
||||||
if (pressed)
|
if (pressed) {
|
||||||
g.setColour(juce::Colour(0xffccaa44));
|
g.setColour(juce::Colour(0xffccaa44));
|
||||||
else
|
} else {
|
||||||
g.setColour(juce::Colour(0xff333333));
|
juce::ColourGradient grad(juce::Colour(0xff444444), static_cast<float>(bx), 0.0f,
|
||||||
|
juce::Colour(0xff222222), static_cast<float>(bx), static_cast<float>(blackKeyHeight), false);
|
||||||
|
g.setGradientFill(grad);
|
||||||
|
}
|
||||||
g.fillRect(rect);
|
g.fillRect(rect);
|
||||||
|
|
||||||
g.setColour(juce::Colour(0xff555555));
|
g.setColour(juce::Colour(0xff555555));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue