diff options
| author | neauoire <aliceffekt@gmail.com> | 2019-11-09 11:11:11 -0500 |
|---|---|---|
| committer | neauoire <aliceffekt@gmail.com> | 2019-11-09 11:11:11 -0500 |
| commit | f7e20d0ae0273dbb9bc2c86a4715e53707279aee (patch) | |
| tree | 61607919456bc6ad6b0b5d4f0765113a2a330b8d /editor/scripts | |
| parent | a0015b535b78ae49e39af1c76bf53b70c14d20b4 (diff) | |
*
Diffstat (limited to 'editor/scripts')
| -rw-r--r-- | editor/scripts/benchmark.js | 7 | ||||
| -rw-r--r-- | editor/scripts/color.js | 2 | ||||
| -rw-r--r-- | editor/scripts/lib/theme.js | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/editor/scripts/benchmark.js b/editor/scripts/benchmark.js index 84c6d1b..69032b2 100644 --- a/editor/scripts/benchmark.js +++ b/editor/scripts/benchmark.js @@ -16,6 +16,7 @@ function Benchmark () { } this.refresh = function () { + console.log('refresh') const el = document.getElementById('print') const html = '' const count = 0 @@ -23,9 +24,9 @@ function Benchmark () { console.log(matches) for (const match of matches) { + const rating = new Color(match.fc).contrast(new Color(match.bc)) const cell = document.getElementById(match.id) - console.log(cell, match.id) - // cell.textContent = '0.0' + cell.textContent = `${rating.toFixed(2)}` } el.innerHTML = html @@ -34,8 +35,6 @@ function Benchmark () { this.log = function (id, fc, bc) { let html = '' - const rating = new Color(fc).contrast(new Color(bc)) - if (rating == 1) { html += `Overlap: <b>${id}</b> <i>${bc}</i>\n` } else if (rating < 1.5) { diff --git a/editor/scripts/color.js b/editor/scripts/color.js index 8296e1e..3aebfc7 100644 --- a/editor/scripts/color.js +++ b/editor/scripts/color.js @@ -1,3 +1,5 @@ +'use strict' + function Color (hex = '#000000') { this.hex = hex diff --git a/editor/scripts/lib/theme.js b/editor/scripts/lib/theme.js index 6a01c24..abb491b 100644 --- a/editor/scripts/lib/theme.js +++ b/editor/scripts/lib/theme.js @@ -21,6 +21,9 @@ function Theme (client) { b_inv: '#ffb545' } + // Callbacks + this.onLoad = () => {} + this.install = (host = document.body) => { window.addEventListener('dragover', this.drag) window.addEventListener('drop', this.drop) |
