Repository: cordova-plugins Updated Branches: refs/heads/master 6d954c0b9 -> 2c4701802
moved named color resolving to JS so platforms can just worry about hex values Project: http://git-wip-us.apache.org/repos/asf/cordova-plugins/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugins/commit/80af194e Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugins/tree/80af194e Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugins/diff/80af194e Branch: refs/heads/master Commit: 80af194ef5f89cb9359fad2c908ccf1ddfaea0c6 Parents: 6d954c0 Author: Jesse MacFadyen <[email protected]> Authored: Thu Mar 6 17:40:01 2014 -0800 Committer: Jesse MacFadyen <[email protected]> Committed: Thu Mar 6 17:40:01 2014 -0800 ---------------------------------------------------------------------- statusbar/www/statusbar.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/80af194e/statusbar/www/statusbar.js ---------------------------------------------------------------------- diff --git a/statusbar/www/statusbar.js b/statusbar/www/statusbar.js index 04b894b..9fee988 100644 --- a/statusbar/www/statusbar.js +++ b/statusbar/www/statusbar.js @@ -23,6 +23,23 @@ var argscheck = require('cordova/argscheck'), utils = require('cordova/utils'), exec = require('cordova/exec'); +var namedColors = { + "black":"#000000", + "darkGray":"#A9A9A9", + "lightGray":"#D3D3D3", + "white":"#FFFFFF", + "gray":"#808080", + "red":"#FF0000", + "green":"#00FF00", + "blue":"#0000FF", + "cyan":"#00FFFF", + "yellow":"#FFFF00", + "magenta":"#FF00FF", + "orange":"##FFA500", + "purple":"#800080", + "brown":"#A52A2A" +}; + // prime it exec(null, null, "StatusBar", "_ready", []); @@ -50,7 +67,7 @@ StatusBar.styleBlackOpaque = function() { }; StatusBar.backgroundColorByName = function(colorname) { - exec(null, null, "StatusBar", "backgroundColorByName", [colorname]); + return StatusBar.backgroundColorByHexString(namedColors[colorname]); } StatusBar.backgroundColorByHexString = function(hexString) {
