From b361e6e7ed1753ad0f7d45c4795e59bc1d7163c9 Mon Sep 17 00:00:00 2001 From: Benson Muite Date: Tue, 30 Jun 2020 11:40:14 +0300 Subject: [PATCH] Fix for better user color selection. (#4142) Colorpallet has 64 colors, not 32, see line 26 in [src/node/db/AuthorManager.js](https://github.com/ether/etherpad-lite/blob/4c45ac3cb1aefcfdeb8871641de01f5d937fb686/src/node/db/AuthorManager.js) By expanding to full range, get better contrasts when there are more than 15 users. It may be helpful to examine color choices a little more and find a better algorithm for automatically assigning colors to users. --- bin/convert.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/convert.js b/bin/convert.js index 69bb2cbc7..82e0f7579 100644 --- a/bin/convert.js +++ b/bin/convert.js @@ -349,7 +349,7 @@ function convertPad(padId, callback) //generate new author values var authorID = "a." + randomString(16); - var authorColorID = authors[i].colorId || Math.floor(Math.random()*32); + var authorColorID = authors[i].colorId || Math.floor(Math.random()*(exports.getColorPalette().length)); var authorName = authors[i].name || null; //overwrite the authorID of the attribute pool