From 7375bd0ca48a6900bb0accc33192425024311b33 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 11 May 2016 16:07:44 -0400 Subject: get colors from currently selected palette --- js/ui/letters.js | 4 +++- js/ui/nopaint.js | 10 ++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'js/ui') diff --git a/js/ui/letters.js b/js/ui/letters.js index 5ed7ffb..d745171 100644 --- a/js/ui/letters.js +++ b/js/ui/letters.js @@ -13,9 +13,11 @@ var letters = (function(){ var lex = new Lex (x,y) return lex }) + + letters.charset = "" letters.repaint = function(charset){ - charset = charset || last_charset + letters.charset = charset = charset || last_charset last_charset = charset var chars = unicode.block(charset, 32) if (chars[0] != " ") chars.unshift(" ") diff --git a/js/ui/nopaint.js b/js/ui/nopaint.js index da6a74b..5ca439b 100644 --- a/js/ui/nopaint.js +++ b/js/ui/nopaint.js @@ -279,11 +279,10 @@ var nopaint = (function(){ var LetterBrush = SolidBrush.extend({ type: "letter", - chars: unicode.block('Basic Latin', 32), recolor: function(){ this.fg = rand_hue() this.bg = rand_hue() - this.char = choice(this.chars) + this.char = choice( unicode.block(letters.charset, 32) ) }, }) @@ -299,14 +298,14 @@ var nopaint = (function(){ this.bg = n } if (Math.random() < 0.7) { - this.char = choice(this.chars) + this.char = choice( unicode.block(letters.charset, 32) ) } this.regenerate() this.__iterate() }, update: function(){ if (Math.random() < 0.3) { - this.char = choice(this.chars) + this.char = choice( unicode.block(letters.charset, 32) ) } this.regenerate() }, @@ -406,11 +405,10 @@ var nopaint = (function(){ var FillLetterTool = FillTool.extend({ type: "fill-letter", rate: 25, - chars: unicode.block('Basic Latin', 32), recolor: function(){ this.fg = randint(16) this.bg = randint(16) - this.char = choice(this.chars) + this.char = choice( unicode.block(letters.charset, 32) ) this.opacity = 1 }, }) -- cgit v1.2.3-70-g09d2