@ustk said in Simple question: How do I change the color of the button state light?:
@VirtualVirgin just use the alpha for the background as well
laf.registerFunction("drawToggleButton", function(g, obj) { //g.setColour(obj.bgColour); g.setColour(Colours.withAlpha(obj.bgColour, obj.value ? 1.0 : 0.5)); // <= this instead g.fillRoundedRectangle(obj.area, 4.0); /* This is not needed since you do it right above, no matter if the button is clicked/hover or not if(obj.over) g.fillRoundedRectangle(obj.area, 4.0); if(obj.down) g.fillRoundedRectangle(obj.area, 4.0); */ g.setColour(Colours.withAlpha(obj.textColour, obj.value ? 1.0 : 0.5)); g.setFont("Arial Bold", 14.0); g.drawAlignedText(obj.text, obj.area, "centred"); });
Thanks! This works just as I expected.