diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-12-09 01:40:49 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-12-09 01:41:14 -0500 |
| commit | 6a16ad9c408fb84dd27c618312f3111563ca2ad5 (patch) | |
| tree | 968ae1a0bbb75af36e8ee0611ca28d8f379fabf4 /js/lex.js | |
| parent | dddd544a566ce53a70351b9fc1391af5034ae09e (diff) | |
blitting functions
Diffstat (limited to 'js/lex.js')
| -rw-r--r-- | js/lex.js | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -10,12 +10,14 @@ function Lex (x,y) { this.fg = colors.white this.bg = colors.black this.char = " " + this.opacity = 1 } Lex.prototype.build = function(){ this.span.className = this.css() this.span.innerHTML = this.html() } Lex.prototype.css = function(){ + if (this.opacity == 0) return "fabb" return "f" + letters[mod(this.fg,16)] + "b" + letters[mod(this.bg,16)] } Lex.prototype.html = function(){ @@ -52,16 +54,17 @@ Lex.prototype.clone = function (lex){ this.fg = lex.fg this.bg = lex.bg this.char = lex.char + this.opacity = lex.opacity this.build() } -Lex.prototype.erase = function (lex){ - if (lex.opacity == 0) return +Lex.prototype.erase = function (){ this.fg = colors.white this.bg = colors.black this.char = " " + this.opacity = 0 this.build() } -Lex.prototype.fill = function(fg,bg){ +Lex.prototype.fill = function(fg, bg){ this.fg = fg this.bg = bg this.opacity = 1 |
