mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
hotfix: define color scheme on heightmap edit
This commit is contained in:
parent
e654dbb8a5
commit
8101e75f3d
7 changed files with 37 additions and 36 deletions
|
|
@ -94,6 +94,13 @@ function applyStyle(style) {
|
|||
if (layerIsOn("toggleTexture") && selector === "#textureImage" && attribute === "src") {
|
||||
el.setAttribute("href", value);
|
||||
}
|
||||
|
||||
// add custom heightmap color scheme
|
||||
if (selector === "#terrs" && attribute === "scheme" && !(value in heightmapColorSchemes)) {
|
||||
const colors = value.split(",");
|
||||
heightmapColorSchemes[value] = d3.scaleSequential(d3.interpolateRgbBasis(colors));
|
||||
document.getElementById("styleHeightmapScheme").options.add(new Option(value, value));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue