fix getPastelColor function (I think)

This commit is contained in:
Devin Howard 2016-10-26 13:53:58 +08:00
parent 8a95262f2c
commit f5712e6979

View file

@ -88,10 +88,10 @@ const Util = {
} }
return coords return coords
}, },
getPastelColor: function ({ rseed, gseed, bseed }) { getPastelColor: function (opts = {}) {
if (rseed === undefined) rseed = Math.random() const rseed = opts.rseed === undefined ? Math.random() : opts.rseed
if (gseed === undefined) gseed = Math.random() const gseed = opts.gseed === undefined ? Math.random() : opts.gseed
if (bseed === undefined) bseed = Math.random() const bseed = opts.bseed === undefined ? Math.random() : opts.bseed
var r = (Math.round(rseed * 127) + 127).toString(16) var r = (Math.round(rseed * 127) + 127).toString(16)
var g = (Math.round(gseed * 127) + 127).toString(16) var g = (Math.round(gseed * 127) + 127).toString(16)
var b = (Math.round(bseed * 127) + 127).toString(16) var b = (Math.round(bseed * 127) + 127).toString(16)