diff options
Diffstat (limited to 'js')
| -rw-r--r-- | js/app.js | 11 | ||||
| -rw-r--r-- | js/lex.js | 4 |
2 files changed, 9 insertions, 6 deletions
@@ -1,7 +1,7 @@ var contentType = 'text/plain;charset=utf-8' -var cols = 80 -var rows = 24 +var cols = 10 +var rows = 5 var dragging = false var drawing = true var erasing = false @@ -9,8 +9,10 @@ var focused var canvas, tools, palette, brush, mode, current_tool -var color_names = ("white black dark-blue green red dark-red purple orange" + +var color_names = ("white black dark-blue green red dark-red purple orange " + "yellow lime dark-cyan cyan blue magenta dark-gray light-gray").split(" "); +var color_hue_order = ("black dark-blue purple dark-red red orange " + + "yellow lime green dark-cyan cyan blue magenta dark-gray light-gray white").split(" "); var letters = "abcdefghijklmnop"; var colors = {}, controls = {} color_names.forEach(function(name, i){ colors[name] = i }) @@ -35,7 +37,8 @@ function build () { }) palette = new Matrix (32, 2, function(x,y){ var lex = new Lex (x,y) - lex.bg = y>>1 + console.log(color_hue_order[y>>1]) + lex.bg = colors[color_hue_order[y>>1]] lex.build() return lex }) @@ -24,10 +24,10 @@ Lex.prototype.html = function(){ Lex.prototype.irc = function(){ if (this.bg == 1 && this.fg == 0) { // return "\\x03" + "," + (this.bg&15) + this.char - return this.char + return this.char == "%" ? '%%' : this.char } else { - return "\\x03" + (this.fg&15) + "," + (this.bg&15) + this.char + return "\\x03" + (this.fg&15) + "," + (this.bg&15) + (this.char == "%" ? '%%' : this.char) } } Lex.prototype.clone = function (lex){ |
