Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
const log = new Proxy({}, {
get: (_, colour) => function() {
console.log(`%c ${[]' ')}`, `color: ${colour}`)
// example
log.tomato('I am tomato')
log.chocolate('I am chocolate')
log.cornflowerblue('I am cornflowerblue')
log.darkcyan('I am darkcyan')
log.goldenrod('I am goldenrod')
Copy link

deepu105 commented Jan 8, 2018

log['#000000']('I am 000000'); you can do this as well

Copy link

robalb commented May 21, 2019


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