From 3be3ef3287f92dcfa1ad00a725ad77a9c32aaea6 Mon Sep 17 00:00:00 2001 From: Henri Bergius Date: Tue, 5 Dec 2017 11:42:17 +0100 Subject: [PATCH] Make heatmap colors more visible --- elements/userlist.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/elements/userlist.js b/elements/userlist.js index 6da2cd8..4092589 100644 --- a/elements/userlist.js +++ b/elements/userlist.js @@ -72,13 +72,12 @@ class UserList extends Component { render({ data }) { const el = document.createElement('div'); - const colormap = interpolate(['blue', 'green', 'yellow', 'red']); - const colorIndex = Math.min(data.length / 22, 22); + const colormap = interpolate(['#3465a4', '#729fcf', '#8ae234', '#fce94f', '#ef2929']); + const colorAtIndex = (val) => colormap(Math.min(val / 22, 22)); el.className = 'terminal'; el.innerHTML = `
user@c-beam> #who
-
${data.join(', ')}
-
total: ${data.length}
+
${data.join(', ')}
user@c-beam> _
`; if (data.join(', ').length > 100) {