# Is it possible to change the color of a Control option when selected?

For this Control inside Manipulate (using Setter or RadioButton):

Control[{{opt,"A"},{"A","B","C"},Setter}]


Is it possible to make the color of the selection change? So if "A" is selected the button is Blue, while "B" and "C" are black.

I read this post about a Button changing colors when clicked and tried to do something similar for my situation but I couldn't get it to work.

• I believe your code should be Control[{{opt,"A"},{"A","B","C"}}]. I don't think you can add the Setter part. Control doesn't take options as far as I know, but if you select the setter you can change its background color in the Option Inspector. – Sjoerd C. de Vries Jun 30 '16 at 20:17
• Use Control[{{opt, "A"}, {"A", "B", "C"}, ControlType -> Setter}] then in another cell evaluate Dynamic[opt] and observe this second cell as you click on the labels in the Setter – Bob Hanlon Jul 1 '16 at 1:33

The way I read the documentation one can only control the background color of a Setter or SetterBar. That is to say the foreground color is not available to the user.

If you are willing to use buttons, then I think you can accomplish your goal. I used Cyan and Gray rather than Blue and Black for visibility.

Manipulate[
Column[{
{opt, colA, colB, colC},

Row[{
Button["A", opt = A; colA = Cyan; colB = Gray;
colC = Gray, Background -> colA],
Button["B", opt = B; colA = Gray; colB = Cyan;
colC = Gray, Background -> colB],
Button["C", opt = C; colA = Gray; colB = Gray;
colC = Cyan, Background -> colC]
}]
}],

{{opt, A}, ControlType -> None},
{{colA, Cyan}, ControlType -> None},
{{colB, Gray}, ControlType -> None},
{{colC, Gray}, ControlType -> None}
]