We can implement this with the C# component in Grasshopper. Set r, g, and b as integers.
privatevoid RunScript(object x, int r, int g, int b, refobject A)
var input = (Component.Params.Input.Sources); //get the first thing connected to the first input of this componentvar slider = (Grasshopper.Kernel.Special.GH_NumberSlider) input; //try to cast that thing as a sliderif(slider != null) //if the component was successfully cast as a slider
decimal max = slider.Slider.Maximum;
Color c = Color.FromArgb(255, r, g, b);
slider.Slider.RailDisplay = Grasshopper.GUI.Base.GH_SliderRailDisplay.Filled; //add progress bar
slider.Slider.RailFullColour = c; //set progress bar colour
Watch the colour update in real time
This is shamelessly a hacky bit of Grasshoppery fun. As much as I like it, this implementation is still not perfect. Whenever you directly change the slider you have edited the colour of, the progress bar disappears. It seems that in the slider.SetSliderValue() method, Grasshopper is setting the slider rail back to the Simple value (the default).
This perhaps points towards the idea that the colour bar was never meant to be implemented at all, and why it can’t be found in the user interface. Or it could point to the possibility that I have just done something wrong, and there is something else I need to implement!