fix(editor): always use random hex colors
chance.color() can output all valid CSS values for colors, including rgba() syntax and predefined color names. Due to the usage of hex2rgb and other methods, this can break the editor. This commit ensures that all randomly generated colors are specified in hex format. Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
@@ -8,6 +8,7 @@ const config = require('./config')
|
||||
exports.generateAvatar = function (name) {
|
||||
// use darker colors for better contrast
|
||||
const color = new Chance(name).color({
|
||||
format: 'hex',
|
||||
max_red: 150,
|
||||
max_green: 150,
|
||||
max_blue: 150
|
||||
|
||||
Reference in New Issue
Block a user