Skip to content

Commit 1ff53de

Browse files
authored
Knob Painter gets a bit more spruced up for body case (#163)
* Knob Painter gets a bit more spruced up for body case
1 parent 55a1fc6 commit 1ff53de

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

src/sst/jucegui/components/KnobPainter.hxx

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,32 @@ template <typename T, typename S> void knobPainter(juce::Graphics &g, T *that, S
173173
.rotated(-0.3)
174174
.translated(knobarea.getWidth() / 2, knobarea.getHeight() / 2));
175175

176-
auto pIn = circle(strokeWidth);
177-
g.setColour(c);
178-
g.fillPath(pIn);
179-
// Flat Style
180-
g.setColour(c.darker(0.4));
181-
g.strokePath(pIn, juce::PathStrokeType(1));
176+
if (strokeWidth > 4)
177+
{
178+
auto pIn = circle(strokeWidth);
179+
auto graded = juce::ColourGradient::vertical(c.brighter(0.2), knobarea.getY(),
180+
c.darker(0.3), knobarea.getBottom());
181+
g.setGradientFill(graded);
182+
// g.setColour(c);
183+
g.fillPath(pIn);
184+
185+
graded = juce::ColourGradient::vertical(c.darker(0.15), knobarea.getY(),
186+
c.brighter(0.25), knobarea.getBottom());
187+
auto pInIn = circle(strokeWidth + 3);
188+
g.setGradientFill(graded);
189+
// g.setColour(c);
190+
g.fillPath(pInIn);
191+
192+
// Flat Style
193+
g.setColour(c.darker(0.4));
194+
g.strokePath(pIn, juce::PathStrokeType(1));
195+
}
196+
else
197+
{
198+
auto pIn = circle(strokeWidth);
199+
g.setColour(c);
200+
g.fillPath(pIn);
201+
}
182202

183203
#if 0
184204
// Specular style

0 commit comments

Comments
 (0)