mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
v1.0.16
This commit is contained in:
parent
c0a634bec1
commit
5a1b747da8
11 changed files with 182 additions and 51 deletions
|
|
@ -201,7 +201,7 @@ function getRandomColor() {
|
|||
|
||||
// mix a color with a random color
|
||||
function getMixedColor(color, mix = .2, bright = .3) {
|
||||
const c = color[0] === "#" ? color : getRandomColor(); // if provided color is not hex (e.g. harching), generate random one
|
||||
const c = color && color[0] === "#" ? color : getRandomColor(); // if provided color is not hex (e.g. harching), generate random one
|
||||
return d3.color(d3.interpolate(c, getRandomColor())(mix)).brighter(bright).hex();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue