diff options
Diffstat (limited to 'trongleposting-client/src/utils')
| -rw-r--r-- | trongleposting-client/src/utils/generate_gruvbox.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/trongleposting-client/src/utils/generate_gruvbox.js b/trongleposting-client/src/utils/generate_gruvbox.js new file mode 100644 index 0000000..7ff109b --- /dev/null +++ b/trongleposting-client/src/utils/generate_gruvbox.js @@ -0,0 +1,14 @@ +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];
\ No newline at end of file |
