the two CSS variables you need to overwrite are --state-input_boolean-on-color and --state-input_boolean-off-color, so your example would look like this:
This’ll work for an input_boolean, other types of entities will require slight adjustments to set e.g. --state-light-on-color.
You can find which variables to set by opening your browser’s devtools then activating the “select” mode (Ctrl+Shift+C in Chrome or Firefox), and clicking on the icon in your picture elements card.
The inspector view will jump to the the HTML code of the icon (probably called ha-svg-icon), then look for its parent called ha-state-icon, marked red here:
That HTML element should have an inline style attribute defining a value for color, composed of a set of CSS variables, if you set one of them it’ll use that value instead of the default colors.