summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2016-03-22 11:36:16 -0400
committerJules Laplace <jules@okfoc.us>2016-03-22 11:36:16 -0400
commit858587af95cfd02341cee1ec1f63c560f6944145 (patch)
tree165b968c7fe9df5d49c07e4ce3b9493faf1cacd5 /js
parent99795bd1552a481dcb8f23e010e836ef06856447 (diff)
use modi
Diffstat (limited to 'js')
-rw-r--r--js/lex.js4
-rw-r--r--js/util.js1
2 files changed, 3 insertions, 2 deletions
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 }