mirror of
https://github.com/apache/cordova-plugin-statusbar.git
synced 2025-01-19 01:12:49 +08:00
support shorthand css color values like #F3D and sanity check for leading octothorp
This commit is contained in:
parent
83cc8464e1
commit
7b648411cd
@ -51,18 +51,22 @@ StatusBar.overlaysWebView = function(doOverlay) {
|
||||
};
|
||||
|
||||
StatusBar.styleDefault = function () {
|
||||
// dark text on a light background
|
||||
exec(null, null, "StatusBar", "styleDefault", []);
|
||||
};
|
||||
|
||||
StatusBar.styleLightContent = function () {
|
||||
// light text on a dark background
|
||||
exec(null, null, "StatusBar", "styleLightContent", []);
|
||||
};
|
||||
|
||||
StatusBar.styleBlackTranslucent = function () {
|
||||
// #88000000 ? Apple says to use lightContent instead
|
||||
exec(null, null, "StatusBar", "styleBlackTranslucent", []);
|
||||
};
|
||||
|
||||
StatusBar.styleBlackOpaque = function () {
|
||||
// #FF000000 ? Apple says to use lightContent instead
|
||||
exec(null, null, "StatusBar", "styleBlackOpaque", []);
|
||||
};
|
||||
|
||||
@ -71,6 +75,15 @@ StatusBar.backgroundColorByName = function(colorname) {
|
||||
}
|
||||
|
||||
StatusBar.backgroundColorByHexString = function (hexString) {
|
||||
if (hexString.indexOf("#") < 0) {
|
||||
hexString = "#" + hexString;
|
||||
}
|
||||
|
||||
if (hexString.length == 4) {
|
||||
var split = hexString.split("");
|
||||
hexString = "#" + hexString[1] + hexString[1] + hexString[2] + hexString[2] + hexString[3] + hexString[3];
|
||||
}
|
||||
|
||||
exec(null, null, "StatusBar", "backgroundColorByHexString", [hexString]);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user