Skip to content

Commit

Permalink
fix order of stile colour gradient helper
Browse files Browse the repository at this point in the history
  • Loading branch information
vsicurella committed Jul 18, 2024
1 parent 162f0ac commit e19b46d
Showing 1 changed file with 44 additions and 42 deletions.
86 changes: 44 additions & 42 deletions Source/LumatoneEditorLookAndFeel.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,49 @@ class LumatoneEditorLookAndFeel : public LookAndFeel_V4
return 0.00555556f;
}

public:

juce::ColourGradient getColourGradient(LumatoneEditorColourGradients gradientId, const juce::Rectangle<float>& area) const
{
switch (gradientId)
{
default:
break;

case LumatoneEditorColourGradients::ExpressionSlider:
return juce::ColourGradient::horizontal(
findColour(LumatoneEditorColourIDs::ExprRotaryGradientMin),
findColour(LumatoneEditorColourIDs::ExprRotaryGradientMax),
area);
case LumatoneEditorColourGradients::BrightnessSlider:
return juce::ColourGradient::horizontal(
findColour(LumatoneEditorColourIDs::BrightnessRotaryGradientMin),
findColour(LumatoneEditorColourIDs::BrightnessRotaryGradientMax),
area);

case LumatoneEditorColourGradients::HueSlider:
{
juce::ColourGradient g = juce::ColourGradient(findColour(LumatoneEditorColourIDs::HueRotaryGradientMin), area.getTopLeft(),
findColour(LumatoneEditorColourIDs::HueRotaryGradientMax), area.getTopRight(),
false);
g.addColour(0.5f, findColour(LumatoneEditorColourIDs::HueRotaryGradientMid));
return g;
}

case LumatoneEditorColourGradients::TemperatureSlider:
{
juce::ColourGradient g = juce::ColourGradient(findColour(LumatoneEditorColourIDs::TempRotaryGradientMin), area.getTopLeft(),
findColour(LumatoneEditorColourIDs::TempRotaryGradientMax), area.getTopRight(),
false);
g.addColour(0.5f, findColour(LumatoneEditorColourIDs::TempRotaryGradientMid));
return g;
}
}

return juce::ColourGradient();
}


public:
//==================================================================
// LookAndFeel_V4 Implementation
Expand Down Expand Up @@ -539,6 +582,7 @@ class LumatoneEditorLookAndFeel : public LookAndFeel_V4
g.drawFittedText(btn.getButtonText(), btn.getLocalBounds().withLeft(btn.getHeight() * 1.5f), Justification::centredLeft, 1);
}


//==================================================================
//
// SLIDER METHODS
Expand Down Expand Up @@ -1400,48 +1444,6 @@ class LumatoneEditorLookAndFeel : public LookAndFeel_V4
setColour(AlertWindow::ColourIds::outlineColourId, findColour(LumatoneEditorColourIDs::MediumBackground));
}

public:

juce::ColourGradient LumatoneEditorLookAndFeel::getColourGradient(LumatoneEditorColourGradients gradientId, const juce::Rectangle<float>& area) const
{
switch (gradientId)
{
default:
break;

case LumatoneEditorColourGradients::ExpressionSlider:
return juce::ColourGradient::horizontal(
findColour(LumatoneEditorColourIDs::ExprRotaryGradientMin),
findColour(LumatoneEditorColourIDs::ExprRotaryGradientMax),
area);
case LumatoneEditorColourGradients::BrightnessSlider:
return juce::ColourGradient::horizontal(
findColour(LumatoneEditorColourIDs::BrightnessRotaryGradientMin),
findColour(LumatoneEditorColourIDs::BrightnessRotaryGradientMax),
area);

case LumatoneEditorColourGradients::HueSlider:
{
juce::ColourGradient g = juce::ColourGradient(findColour(LumatoneEditorColourIDs::HueRotaryGradientMin), area.getTopLeft(),
findColour(LumatoneEditorColourIDs::HueRotaryGradientMax), area.getTopRight(),
false);
g.addColour(0.5f, findColour(LumatoneEditorColourIDs::HueRotaryGradientMid));
return g;
}

case LumatoneEditorColourGradients::TemperatureSlider:
{
juce::ColourGradient g = juce::ColourGradient(findColour(LumatoneEditorColourIDs::TempRotaryGradientMin), area.getTopLeft(),
findColour(LumatoneEditorColourIDs::TempRotaryGradientMax), area.getTopRight(),
false);
g.addColour(0.5f, findColour(LumatoneEditorColourIDs::TempRotaryGradientMid));
return g;
}
}

return juce::ColourGradient();
}

private:

const LumatoneEditorFontLibrary& appFonts;
Expand Down

0 comments on commit e19b46d

Please sign in to comment.