Skip to content

Commit b044c2a

Browse files
committed
Use randomcolor not seedrandom for avatar backgrounds
1 parent 01361af commit b044c2a

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

lib/letter-avatars.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
"use strict";
22

33
// external modules
4-
var seedrandom = require('seedrandom');
4+
var randomcolor = require('randomcolor');
55

66
// core
77
module.exports = function(name) {
8-
var colors = ["#5A8770", "#B2B7BB", "#6FA9AB", "#F5AF29", "#0088B9", "#F18636", "#D93A37", "#A6B12E", "#5C9BBC", "#F5888D", "#9A89B5", "#407887", "#9A89B5", "#5A8770", "#D33F33", "#A2B01F", "#F0B126", "#0087BF", "#F18636", "#0087BF", "#B2B7BB", "#72ACAE", "#9C8AB4", "#5A8770", "#EEB424", "#407887"];
9-
var color = colors[Math.floor(seedrandom(name)() * colors.length)];
8+
var color = randomcolor({seed: name});
109
var letter = name.substring(0, 1).toUpperCase();
1110

1211
var svg = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>';

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@
9999
"reveal.js": "^3.3.0",
100100
"sequelize": "^3.24.3",
101101
"scrypt": "^6.0.3",
102-
"seedrandom": "^2.4.2",
103102
"select2": "^3.5.2-browserify",
104103
"sequelize-cli": "^2.4.0",
105104
"shortid": "2.2.6",

0 commit comments

Comments
 (0)