Merge branch 'develop' of github.com:thecodingmachine/workadventure into main

This commit is contained in:
_Bastler
2021-07-02 20:59:39 +02:00
58 changed files with 2227 additions and 1746 deletions
+6 -6
View File
@@ -1,4 +1,4 @@
export function getColorByString(str: string) : string|null {
export function getColorByString(str: string): string | null {
let hash = 0;
if (str.length === 0) {
return null;
@@ -7,10 +7,10 @@ export function getColorByString(str: string) : string|null {
hash = str.charCodeAt(i) + ((hash << 5) - hash);
hash = hash & hash;
}
let color = '#';
let color = "#";
for (let i = 0; i < 3; i++) {
const value = (hash >> (i * 8)) & 255;
color += ('00' + value.toString(16)).substr(-2);
color += ("00" + value.toString(16)).substr(-2);
}
return color;
}
@@ -20,8 +20,8 @@ export function srcObject(node: HTMLVideoElement, stream: MediaStream) {
return {
update(newStream: MediaStream) {
if (node.srcObject != newStream) {
node.srcObject = newStream
node.srcObject = newStream;
}
}
}
},
};
}