Last active
June 18, 2018 08:36
-
-
Save seksenov/9c526800e8372eebe6e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setAppBarColors(brandColorHex, brandColorInactiveHex) { | |
// Detect if the Windows namespace exists in the global object | |
if (typeof Windows !== 'undefined') { | |
var brandColor = hexStrToRGBA(brandColorHex); | |
var brandColorInactive = hexStrToRGBA(brandColorInactiveHex); | |
// Get a reference to the App Title Bar | |
var appTitleBar = Windows.UI.ViewManagement.ApplicationView.getForCurrentView().titleBar; | |
var black = hexStrToRGBA('#000'); | |
var white = hexStrToRGBA('#FFF'); | |
appTitleBar.foregroundColor = white; | |
appTitleBar.backgroundColor = brandColor; | |
appTitleBar.buttonForegroundColor = white; | |
appTitleBar.buttonBackgroundColor = brandColor; | |
appTitleBar.buttonHoverForegroundColor = white; | |
appTitleBar.buttonHoverBackgroundColor = brandColor; | |
appTitleBar.buttonPressedForegroundColor = brandColor; | |
appTitleBar.buttonPressedBackgroundColor = white; | |
appTitleBar.inactiveBackgroundColor = brandColorInactive; | |
appTitleBar.inactiveForegroundColor = brandColor; | |
appTitleBar.buttonInactiveForegroundColor = brandColor; | |
appTitleBar.buttonInactiveBackgroundColor = brandColorInactive; | |
appTitleBar.buttonInactiveHoverForegroundColor = brandColor; | |
appTitleBar.buttonInactiveHoverBackgroundColor = brandColorInactive; | |
appTitleBar.buttonPressedForegroundColor = brandColor; | |
appTitleBar.buttonPressedBackgroundColor = brandColorInactive; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment