refactor(es modules): migrate colorUtils

This commit is contained in:
Azgaar 2022-06-26 01:49:41 +03:00
parent 364f33975f
commit b425a9daf6
12 changed files with 63 additions and 49 deletions

View file

@ -1,6 +1,7 @@
import {TIME} from "/src/config/logging";
import {findCell} from "/src/utils/graphUtils";
import {layerIsOn} from "./ui/layers";
import {getColors, getRandomColor, getMixedColor} from "/src/utils/colorUtils";
window.BurgsAndStates = (function () {
const generate = function () {

View file

@ -1,4 +1,5 @@
import {TIME} from "/src/config/logging";
import {getColors} from "/src/utils/colorUtils";
window.Cultures = (function () {
let cells;

View file

@ -2,6 +2,7 @@ import {restoreDefaultEvents} from "/src/scripts/events";
import {findAll, findCell, getPackPolygon, isLand} from "/src/utils/graphUtils";
import {byId} from "/src/utils/shorthands";
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
import {getRandomColor, getMixedColor} from "/src/utils/colorUtils";
const $body = insertEditorHtml();
addListeners();

View file

@ -1,6 +1,7 @@
import {TIME} from "/src/config/logging";
import {findAll} from "/src/utils/graphUtils";
import {unique} from "/src/utils/arrayUtils";
import {getRandomColor, getMixedColor} from "/src/utils/colorUtils";
window.Religions = (function () {
// name generation approach and relative chance to be selected

View file

@ -1,6 +1,7 @@
import {restoreDefaultEvents} from "/src/scripts/events";
import {findAll, findCell, getPackPolygon, isLand} from "/src/utils/graphUtils";
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
import {getRandomColor} from "/src/utils/colorUtils";
export function editBiomes() {
if (customization) return;

View file

@ -2,6 +2,7 @@ import {restoreDefaultEvents} from "/src/scripts/events";
import {findAll, findCell, getPackPolygon, isLand} from "/src/utils/graphUtils";
import {unique} from "/src/utils/arrayUtils";
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
import {getRandomColor} from "/src/utils/colorUtils";
export function editProvinces() {
if (customization) return;

View file

@ -24,7 +24,7 @@ const customPresetPrefix = "fmgStyle_";
document.getElementById("stylePreset").innerHTML = options;
}
async function applyStyleOnLoad() {
export async function applyStyleOnLoad() {
const desiredPreset = localStorage.getItem("presetStyle") || "default";
const styleData = await getStylePreset(desiredPreset);
const [appliedPreset, style] = styleData;