# LookAndFeelV4::drawLinearSlider is incomplete

**URL:** <https://forum.juce.com/t/lookandfeelv4-drawlinearslider-is-incomplete/64164>\
**Category:** General JUCE discussion\
**Created:** [November 12, 2024, 2:36am UTC](https://forum.juce.com/t/lookandfeelv4-drawlinearslider-is-incomplete/64164 "2024-11-12T02:36:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hotland3x3](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/hotland3x3/32/18808_2.png) [@hotland3x3](https://forum.juce.com/u/hotland3x3)\
**Post date:** [November 12, 2024, 2:36am UTC](https://forum.juce.com/t/lookandfeelv4-drawlinearslider-is-incomplete/64164/1 "2024-11-12T02:36:39Z")

</div>

`juce:LookAndFeelV4::drawLinearSlider` paints the slider track and thumb with the same color for both isEnabled() states

 ![Screenshot 2024-11-12 at 08.57.56](https://us1.discourse-cdn.com/flex026/uploads/juce/original/3X/4/a/4afcf73fb27ed6687ecac85f3102da2a827ab194.png)

That honestly didn’t look so good, especially compared with disabling other components like ComboBox. It even looked bad compared with the slider’s own textbox!

The fix is very simple though. Overriding `drawLinearSlider` and adding `Colour::withMultipliedSaturation` to these lines that sets the track color and thumb color works:

`// track color`  
`g.setColour (slider.findColour (Slider::trackColourId).withMultipliedSaturation(slider.isEnabled() ? 1.0f : 0.5f));`

`// thumb color`  
`g.setColour (slider.findColour (Slider::thumbColourId).withMultipliedSaturation(slider.isEnabled() ? 1.0f : 0.5f));`

 ![Screenshot 2024-11-12 at 08.57.56 (1)](https://us1.discourse-cdn.com/flex026/uploads/juce/original/3X/d/5/d5e50d7b8c24465256ea05ad218e423c14edef39.png)

Much more uniform and objectively better. I know this is such a simple fix and a two liner, but I feel like this should have worked out of the box. Especially if slider is the odd one out here. Thanks!

~hotland

---

<div class="post-metadata">

**Author:** ![ibisum](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ibisum/32/21288_2.png) [@ibisum](https://forum.juce.com/u/ibisum)\
**Post date:** [November 12, 2024, 10:13am UTC](https://forum.juce.com/t/lookandfeelv4-drawlinearslider-is-incomplete/64164/2 "2024-11-12T10:13:19Z")

</div>

An interesting fix, but you’ve still got issues with colour blind users with this scheme.

The difference in contrast is not great enough for colour blind folks to differentiate the state.

You can use this tool to evaluate your UI for colour blind folks, and if you have separate design folks working on your project, it’d be wise to get them to test against this tool on the regular:

[https://www.color-blindness.com/coblis-color-blindness-simulator/](https://www.color-blindness.com/coblis-color-blindness-simulator/)

---

<div class="post-metadata">

**Author:** ![hotland3x3](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/hotland3x3/32/18808_2.png) [@hotland3x3](https://forum.juce.com/u/hotland3x3)\
**Post date:** [November 13, 2024, 7:52am UTC](https://forum.juce.com/t/lookandfeelv4-drawlinearslider-is-incomplete/64164/3 "2024-11-13T07:52:57Z")

</div>

Great point. I feel like combining it with `withMultipliedLightness` and make it brighter can create a more inclusive muted look. Gotta play with good numbers for that. Thank you for pointing that out!

~hotland
