diff options
author | Logan Hunt <loganhunt@simponic.xyz> | 2022-03-30 22:15:20 -0600 |
---|---|---|
committer | Logan Hunt <loganhunt@simponic.xyz> | 2022-03-30 22:15:20 -0600 |
commit | 42cf50ee7521bd751f4d0f0798276e548bb83fee (patch) | |
tree | 5b2e8877a137a9b62ea630cc69135183804131d5 /client/utils/generate_gruvbox.js | |
parent | ae0c829453d4663203887979349047850cb98626 (diff) | |
download | locchat-42cf50ee7521bd751f4d0f0798276e548bb83fee.tar.gz locchat-42cf50ee7521bd751f4d0f0798276e548bb83fee.zip |
Working
Diffstat (limited to 'client/utils/generate_gruvbox.js')
-rw-r--r-- | client/utils/generate_gruvbox.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/client/utils/generate_gruvbox.js b/client/utils/generate_gruvbox.js new file mode 100644 index 0000000..033d893 --- /dev/null +++ b/client/utils/generate_gruvbox.js @@ -0,0 +1,19 @@ +// This is also from https://github.com/USUFSLC/sochat +const gruvboxColors = [ + '#b8bb26', + '#fabd2f', + '#83a598', + '#d3869b', + '#8ec07c', + '#458588', + '#cc241d', + '#d65d0e', + '#bdae93', +]; + +export const generateGruvboxFromString = (string) => + gruvboxColors[ + Array.from(string) + .map((x) => x.charCodeAt(0)) + .reduce((a, x) => a + x, 0) % gruvboxColors.length + ]; |