Skip to content

Support system accent color retrieval with UIColorType.Accent #4444

Description

@MartinZikmund

What would you like to be added:

UISettings class allows retrieval of UIColorType.Accent and its darker and lighter versions. This can be supported on Android where system accent color can be set.

Why is this needed:

UWP parity.

Resources

For which Platform:

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Skia
    • WPF
    • GTK (Linux)
    • Tizen
  • Windows
  • Build tasks
  • Solution Templates

Activity

  1. added
    kind/enhancement
    triage/untriaged
    on Nov 2, 2020
  2. MartinZikmund commented on Nov 2, 2020

    @MartinZikmund
    MemberAuthor

    Gotchas:

    • The accent color can potentially be anything (its "rules" are not clearly defined). We need to ensure that we don't use it as the "default accent" color, in case it would break accessibility (or adjust it by shifting the color to a safe range)
    • It will require adding some color helpers for RGB -> HSL conversion, so the color brightness can be changed properly to scale to darker/lighter
  3. davidjohnoliver commented on Nov 2, 2020

    @davidjohnoliver
    Contributor

    Note that (according to UWP docs at least, I haven't tested) the base accent color can also be overridden by app code:

    <Application.Resources>
        <ResourceDictionary>
            <Color x:Key="SystemAccentColor">#107C10</Color>
        </ResourceDictionary>
    </Application.Resources>
  4. MartinZikmund commented on Nov 2, 2020

    @MartinZikmund
    MemberAuthor

    @davidjohnoliver we have that tracked in #3555 , that would be even more useful to support 👍 (I think most apps override accent color anyway). However, even if overwritten in resources, UISettings should still return the "system" color.

  5. added
    project/styling 👔
    and removed
    triage/untriaged
    on Nov 2, 2020
  6. added
    difficulty/tbd
    on Feb 15, 2021
  7. added
    difficulty/challenging 🤯
    and removed
    difficulty/tbd
    on Jun 4, 2021
  8. jeromelaban commented on Oct 21, 2021

    @jeromelaban
    Member

    Browsers also support this feature now: w3c/csswg-drafts#5187 (comment)

  9. jeromelaban commented on Apr 9, 2022

    @jeromelaban
    Member

    Now supported in major browsers: https://twitter.com/una/status/1506383666548822020

    Twitter
    “`accent-color` is now supported in all modern browsers 🎉🎨

    One line of code enables you to style previously-hard-to-access form controls like checkboxes and radio buttons

    body {
    accent-color: hotpink;
    }

    Works really nicely with the color-scheme property too! https://t.co/YRFQYyKQ2G”

  10. kucint commented on May 13, 2024

    @kucint

    @MartinZikmund: Uno currently only uses the default "windows" blue, and is ignoring the windows "accent-color", see #16608
    Can this be fixed?

  11. added theissue type on Jul 17, 2025
  12. MartinZikmund commented on Apr 7, 2026

    @MartinZikmund
    MemberAuthor

    Repro generator

    This issue was classified as not reproducible with a code sample or test.

    Reason: UISettings.GetColorValue(UIColorType.Accent) exists but returns a hardcoded blue color instead of the actual Android system accent color. Getting the real system accent requires Android-specific APIs (TypedValue/R.attr.colorAccent) and a live Android device to verify — this cannot be tested with a self-contained runtime test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty/challenging 🤯kind/enhancementno-reproproject/styling 👔

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions