Reputation: 153
Is there a way to detect the Background and Accent colour in Windows Phone 7 using web technologies like JavaScript and change the colours in my CSS accordingly? I've looked everywhere without any success!
Upvotes: 0
Views: 261
Reputation: 1135
There is a possibility to access the accent color directly via CSS: use the property Highlight
. This way, you can also access the accent color in Windows Phone 8 Apps written in HTML5. In other Browsers, for example Safari, Highlight
will result in the Highlight color, of course...
To get the suitable Text color in native HTML5 Apps, HighlightText
can be used. As for my Tests, this doesn't work in Windows Phone 7 and results in black anyway.
Upvotes: 0
Reputation: 39047
There's no way to interact with the phone OS using javascript (or any technology supported by the phone's web browser). So either the information is available in the user-agent (and I'm pretty sure it isn't), or you can't do that.
If you're using the WebBrowser control inside of a phone app, there's probably a few workarounds. But for the native internet explorer app there's nothing you can do.
Upvotes: 1