Skip to content

Instantly share code, notes, and snippets.

@pankajladhar
Last active February 21, 2018 05:28
Show Gist options
  • Save pankajladhar/70629949cf093b0ae90b8c0d4f5539d3 to your computer and use it in GitHub Desktop.
Save pankajladhar/70629949cf093b0ae90b8c0d4f5539d3 to your computer and use it in GitHub Desktop.
var console=(function(oldCons){
logMethod = function(color, msg){
oldCons.log('%c' + msg , 'color:' + color);
}
return {
violet: function(msg){
logMethod("#9400D3", msg)
},
indigo: function(msg){
logMethod("#4B0082", msg)
},
blue: function(msg){
logMethod("#0000FF", msg)
},
green: function(msg){
logMethod("#008000", msg)
},
yellow: function(msg){
logMethod("#FFFF00", msg)
},
orange: function(msg){
logMethod("#FFA500", msg)
},
red: function(msg){
logMethod("#ff0000", msg)
}
};
}(window.console));
//console.violet("violet");
//console.indigo("indigo");
//console.blue("blue");
//console.green("green");
//console.yellow("yellow");
//console.orange("orange");
//console.red("red");
@pankajladhar
Copy link
Author

pankajladhar commented Feb 21, 2018

Fixed Typo. Thanks !! .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment