summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu Cheng-Han2016-07-30 11:31:29 +0800
committerWu Cheng-Han2016-07-30 11:31:29 +0800
commitf69a5361cbbc81a78a7b6a6a623dea0700f84d44 (patch)
tree9df2e5042ef2f8dbe7783ac5971bf82ad95196ee
parenta8c12d0d216276015d5bc57f17cf7306191fd125 (diff)
Update to make random color more discrete
Diffstat (limited to '')
-rw-r--r--lib/realtime.js10
-rw-r--r--public/js/index.js4
2 files changed, 4 insertions, 10 deletions
diff --git a/lib/realtime.js b/lib/realtime.js
index 1c99f02e..11de294d 100644
--- a/lib/realtime.js
+++ b/lib/realtime.js
@@ -756,13 +756,11 @@ function connection(socket) {
//initialize user data
//random color
- var color = randomcolor({
- luminosity: 'light'
- });
+ var color = randomcolor();
//make sure color not duplicated or reach max random count
if (notes[noteId]) {
var randomcount = 0;
- var maxrandomcount = 5;
+ var maxrandomcount = 10;
var found = false;
do {
Object.keys(notes[noteId].users).forEach(function (user) {
@@ -772,9 +770,7 @@ function connection(socket) {
}
});
if (found) {
- color = randomcolor({
- luminosity: 'light'
- });
+ color = randomcolor();
randomcount++;
}
} while (found && randomcount < maxrandomcount);
diff --git a/public/js/index.js b/public/js/index.js
index 67ef45b3..919626c2 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -184,9 +184,7 @@ var supportExtraTags = [
text: '[random color tag]',
search: '[]',
command: function () {
- var color = randomColor({
- luminosity: 'light'
- });
+ var color = randomColor();
return '[color=' + color + ']';
}
}