Skip to content

Accent color/text color in dark mode override #3378

Answered by shark0151
shark0151 asked this question in Q&A
Discussion options

You must be logged in to vote

I can get the result I want by setting the deltas to much lower values
You can get the consistently colored buttons with this (although it is still probably a good idea to adjust dark mode contrast for legibility)

public async Task ModeSwitch(LuminanceChangedEventArgs eventArgs)
{
    //Maintain consistent button color between light/dark mode
    if (eventArgs.IsDark)
    {
        //Matching light mode contrast
        // If changing values maintain offset to keep fluent contrast ratio
        await RestDelta.WithDefault(-19);   // -x           x=19(keep lighmode luminance)
        await HoverDelta.WithDefault(-17);  // -(x-2)
        await ActiveDelta.WithDefault(-14); // -(x-5)
       …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@shark0151
Comment options

@vnbaaij
Comment options

@shark0151
Comment options

Answer selected by shark0151
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants