mirror of https://github.com/status-im/codimd.git
Update to make random color more discrete
This commit is contained in:
parent
a8c12d0d21
commit
f69a5361cb
|
@ -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);
|
||||
|
|
|
@ -184,9 +184,7 @@ var supportExtraTags = [
|
|||
text: '[random color tag]',
|
||||
search: '[]',
|
||||
command: function () {
|
||||
var color = randomColor({
|
||||
luminosity: 'light'
|
||||
});
|
||||
var color = randomColor();
|
||||
return '[color=' + color + ']';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue