How to get the "Accent" color on iOS and Android platform

Hello,
Is it a simple way to get the current "Accent" color used by the device?
For example, in android it's a blue, in iOS also blue.

In order to make my application looks like native apllication, how can I get the exact color?

I tried "Color.Accent" in Xamarin Forms, but it doesn't return the color I used by the device to display selected items or menu items.

Thank you in advance

Best Answer

  • Jean-DanielGasserJean-DanielGasser CH ✭✭
    Accepted Answer

    Hello,
    Since latest version of Xamarin.Forms, there is an "Accent" property in colors enumerators, so my question is not necessary anymore.

Answers

  • JohnMillerJohnMiller USForum Administrator, Xamarin Team Xamurai

    @Jean-DanielGasser,

    I didn't know the answer to this. Out of curiosity I did find this. You would have to do something natively to get this information. Perhaps using the DepedencyService if you want to get it from the shared code.

  • Jean-DanielGasserJean-DanielGasser CHMember ✭✭
    Accepted Answer

    Hello,
    Since latest version of Xamarin.Forms, there is an "Accent" property in colors enumerators, so my question is not necessary anymore.

Sign In or Register to comment.