This commit is contained in:
Khush Jammu 2020-06-06 18:50:30 +08:00
commit e5c92fe436
1 changed files with 2 additions and 2 deletions

View File

@ -838,7 +838,7 @@ function handleRecieveMessage(msg, color) {
}
function uuidToHue(uuid) {
// Using uuid to generate random. unique pastel color
// Using uuid to generate random, unique pastel color
var hash = 0;
for (var i = 0; i < uuid.length; i++) {
hash = uuid.charCodeAt(i) + ((hash << 5) - hash);
@ -857,6 +857,7 @@ function uuidToHue(uuid) {
}
}
}
VideoChat.peerColors.set(uuid, hue);
return hue;
}
@ -868,7 +869,6 @@ function hueToColor(hue) {
function setStreamColor(uuid) {
const hue = uuidToHue(uuid);
document.querySelectorAll(`[uuid="${uuid}"]`)[0].style.border = `3px solid ${hueToColor(hue)}`;
VideoChat.peerColors.set(uuid, hue);
}
// Show and hide chat