Skip to content

Instantly share code, notes, and snippets.

Forked from davidgilbertson/color-log.js
Last active May 21, 2019 14:11
  • Star 20 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
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