Changed the avatar color to checkmate blue color
This commit is contained in:
1 parent
265af61100
commit
e30b64bed3
1 file changed
+1
-12
@@ -9,19 +9,8 @@ import { useEffect, useState } from "react";
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
const stringToColor = (string) => {
|
const stringToColor = (string) => {
|
||||||
let hash = 0;
|
|
||||||
let i;
|
|
||||||
for (i = 0; i < string.length; i += 1) {
|
|
||||||
hash = string.charCodeAt(i) + ((hash << 5) - hash);
|
|
||||||
}
|
|
||||||
|
|
||||||
let color = "#";
|
return "#156EEF";
|
||||||
for (i = 0; i < 3; i += 1) {
|
|
||||||
const value = (hash >> (i * 8)) & 0xff;
|
|
||||||
color += `00${value.toString(16)}`.slice(-2);
|
|
||||||
}
|
|
||||||
|
|
||||||
return color;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in new issue
Block a user