Created
May 21, 2017 12:47
-
-
Save IUnknown68/89ea36472a2c9f0645bc970fabdb1003 to your computer and use it in GitHub Desktop.
Adds color functions to the browser-console (e.g. console.green() or console.greenB() for bold-green. Simple and primitive.
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
(() => { | |
['white', 'silver', 'gray', 'black', 'red', 'maroon', 'yellow', 'olive', 'lime', | |
'green', 'aqua', 'teal', 'blue', 'navy', 'fuchsia', 'purple' | |
].forEach(color => { | |
console[color] = (...args) => { | |
console.log(`%c${args.join(' ')}`, `color:${color}`) | |
} | |
console[`${color}B`] = (...args) => { | |
console.log(`%c${args.join(' ')}`, `color:${color};font-weight:bold`) | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment