29 lines
565 B
JavaScript
29 lines
565 B
JavaScript
|
(function() {
|
||
|
var code, method, _ref;
|
||
|
window.Intense = {
|
||
|
colors: {
|
||
|
black: 0,
|
||
|
red: 1,
|
||
|
green: 2,
|
||
|
yellow: 3,
|
||
|
blue: 4,
|
||
|
magenta: 5,
|
||
|
cyan: 6,
|
||
|
white: 7
|
||
|
},
|
||
|
methods: {
|
||
|
foreground: function(color) {
|
||
|
return "\033[3" + Intense.colors[color] + "m" + this + "\033[0m";
|
||
|
},
|
||
|
bright: function() {
|
||
|
return "\033[1m" + this + "\033[0m";
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
_ref = Intense.methods;
|
||
|
for (method in _ref) {
|
||
|
code = _ref[method];
|
||
|
String.prototype[method] = code;
|
||
|
}
|
||
|
}).call(this);
|