Change color for switch

Hi,
I’m trying to change the color for switch “system-wide” but I can’t seem to get it to work. I want to change the color when it’s checked and unchecked. I have the following code in my @Themes can someone tell me what I’m doing wrong?
I know that track and checked are where I want to change the color (classes)

Here is the API but CSS etc. are not my strong side.
Switch API - Material UI (mui.com)

        MuiSwitch = @{
            track   = @{
                color = 'rgba(0, 151, 207, 0.6)'
            }
            checked = @{
                color = 'rgba(80, 184, 72, 0.3)'
            }
        }
Product: PowerShell Universal
Version: 3.0.2

Edit:
So I can now change the background color but it’s all the time I want one color when it checked and one when it’s unchecked.

        MuiSwitch = @{
            track = @{
                'background-color' = 'rgba(0, 151, 207, 0.6)'
            }
        }

So just one thing missing now.

Edit:
I did notice that the color that I’m specifying in the code above are not the correct color that are displayed.
image

And this is the “real” color and it’s the same color code used in both.
image

Edit:
The color issue are solved by adding opacity = '1'

I have not figured out yet how I can change the colour when I have it checked either.

Bump, anyone?

Got it;

        MuiSwitch = @{
            switchBase = @{
                '&.Mui-checked + .MuiSwitch-track' = @{
                    opacity            = '1'
                    'background-color' = 'rgba(80, 184, 72, 0.3)'
                }
            }
            track      = @{
                opacity            = '1'
                'background-color' = 'rgba(0, 151, 207, 0.6)'
            }
        }
2 Likes