2011-10-24 20:40:08 +00:00
|
|
|
window.Intense = {
|
|
|
|
colors:
|
|
|
|
black: 0
|
|
|
|
red: 1
|
|
|
|
green: 2
|
|
|
|
yellow: 3
|
|
|
|
blue: 4
|
|
|
|
magenta: 5
|
|
|
|
cyan: 6
|
|
|
|
white: 7
|
|
|
|
methods:
|
|
|
|
foreground: (color) ->
|
2011-10-25 19:41:22 +00:00
|
|
|
if Intense.useColors
|
2012-04-18 14:52:14 +00:00
|
|
|
"\x33[3#{Intense.colors[color]}m#{this}\x33[0m"
|
2011-10-25 19:41:22 +00:00
|
|
|
else
|
|
|
|
this
|
2011-10-24 20:40:08 +00:00
|
|
|
bright: ->
|
2011-10-25 19:41:22 +00:00
|
|
|
if Intense.useColors
|
2012-04-18 14:52:14 +00:00
|
|
|
"\x33[1m#{this}\x33[0m"
|
2011-10-25 19:41:22 +00:00
|
|
|
else
|
|
|
|
this
|
|
|
|
useColors: true
|
2011-11-21 16:33:51 +00:00
|
|
|
moveBack: (count = 1) -> "\033[#{count}D"
|
2011-10-24 20:40:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for method, code of Intense.methods
|
|
|
|
String.prototype[method] = code
|
|
|
|
|