-
-
Save OutThisLife/a02f2fe8470d224359ff753484740a9b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const log = new Proxy({}, { | |
get: (_, colour) => function() { | |
console.log(`%c ${[].slice.call(arguments).join(' ')}`, `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') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
log['#000000']('I am 000000');
you can do this as well