aboutsummaryrefslogtreecommitdiff
path: root/editor/scripts
diff options
context:
space:
mode:
authorneauoire <aliceffekt@gmail.com>2019-11-09 14:16:41 -0500
committerneauoire <aliceffekt@gmail.com>2019-11-09 14:16:41 -0500
commit2c7becbe4b0defa6a6e80d46ca312fd028f1075d (patch)
treee559cb3dc9067d8b79af9f0f26968cce80ee2a5e /editor/scripts
parent7c03ef84374e11abe34c0770dd277e8348aefd72 (diff)
Improved the benchmark
Diffstat (limited to 'editor/scripts')
-rw-r--r--editor/scripts/benchmark.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/editor/scripts/benchmark.js b/editor/scripts/benchmark.js
index 7b04fd1..8838e2b 100644
--- a/editor/scripts/benchmark.js
+++ b/editor/scripts/benchmark.js
@@ -44,7 +44,6 @@ function Benchmark () {
}
// Order
-
const fhigh = new Color(theme.active.f_high).contrast(new Color(theme.active.background))
const fmed = new Color(theme.active.f_med).contrast(new Color(theme.active.background))
const flow = new Color(theme.active.f_low).contrast(new Color(theme.active.background))
@@ -57,6 +56,17 @@ function Benchmark () {
if (bmed < blow) { logs.push('flip b_med with b_low') }
if (bhigh < bmed) { logs.push('flip b_high with b_med') }
+ // Distribution
+ const fsum = fhigh + fmed + flow
+ document.getElementById('dis_f_high').style.width = `${((fhigh / fsum) * 100).toFixed(2)}%`
+ document.getElementById('dis_f_med').style.width = `${((fmed / fsum) * 100).toFixed(2)}%`
+ document.getElementById('dis_f_low').style.width = `${((flow / fsum) * 100).toFixed(2)}%`
+
+ const bsum = bhigh + bmed + blow
+ document.getElementById('dis_b_high').style.width = `${((bhigh / bsum) * 100).toFixed(2)}%`
+ document.getElementById('dis_b_med').style.width = `${((bmed / bsum) * 100).toFixed(2)}%`
+ document.getElementById('dis_b_low').style.width = `${((blow / bsum) * 100).toFixed(2)}%`
+
const perc = (score / (this.matches().length * 5)) * 100
const cat = errors > 0 ? 'fix errors' : perc === 100 ? 'perfect' : perc > 80 ? 'good' : perc > 75 ? 'average' : 'bad'