fix getPastelColor function (I think)
This commit is contained in:
parent
8a95262f2c
commit
f5712e6979
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Reference in a new issue