From 858587af95cfd02341cee1ec1f63c560f6944145 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 22 Mar 2016 11:36:16 -0400 Subject: use modi --- js/lex.js | 4 ++-- js/util.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/lex.js b/js/lex.js index 8a6d248..e684eea 100644 --- a/js/lex.js +++ b/js/lex.js @@ -23,8 +23,8 @@ Lex.prototype.css = function(){ "focused " : "" ) + ( this.opacity === 0 ? - "transparent f" + color_alphabet[mod(this.fg,16)] : - "f" + color_alphabet[mod(this.fg,16)] + " b" + color_alphabet[mod(this.bg,16)] + "transparent f" + color_alphabet[modi(this.fg,16)] : + "f" + color_alphabet[modi(this.fg,16)] + " b" + color_alphabet[modi(this.bg,16)] ) } Lex.prototype.html = function(){ diff --git a/js/util.js b/js/util.js index 2426973..6d297a1 100644 --- a/js/util.js +++ b/js/util.js @@ -52,6 +52,7 @@ function deg(n){ return n*180/PI } function rad(n){ return n*PI/180 } function xor(a,b){ a=!!a; b=!!b; return (a||b) && !(a&&b) } function mod(n,m){ return n-(m * floor(n/m)) } +function modi(n,m){ return floor(n-(m * floor(n/m))) } function dist(x0,y0,x1,y1){ return sqrt(pow(x1-x0,2)+pow(y1-y0,2)) } function angle(x0,y0,x1,y1){ return atan2(y1-y0,x1-x0) } function avg(m,n,a){ return (m*(a-1)+n)/a } -- cgit v1.2.3-70-g09d2