diff --git a/lib/colors.js b/lib/colors.js index 96ed4a7..2238270 100644 --- a/lib/colors.js +++ b/lib/colors.js @@ -116,6 +116,13 @@ function applyStyle() { } colors.setTheme = function (theme) { + if (typeof theme === 'string') { + console.log('colors.setTheme now only accepts an object, not a string. ' + + 'If you are trying to set a theme from a file, it is now your (the caller\'s) responsibility to require the file. ' + + 'The old syntax looked like colors.setTheme(__dirname + \'/../themes/generic-logging.js\'); ' + + 'The new syntax looks like colors.setTheme(require(__dirname + \'/../themes/generic-logging.js\'));'); + return; + } for (var style in theme) { (function(style){ colors[style] = function(str){ @@ -169,4 +176,4 @@ for (var map in colors.maps) { })(map) } -defineProps(colors, init()); \ No newline at end of file +defineProps(colors, init());