Add getColor() to utils

This commit is contained in:
Johannes Zellner
2025-10-15 21:51:17 +02:00
parent d8771509cd
commit 576d9ca894
2 changed files with 11 additions and 21 deletions
+9 -2
View File
@@ -671,6 +671,11 @@ const cronDays = [
// generates 24h time sets (instead of american 12h) to avoid having to translate everything to locales eg. 12:00
const cronHours = Array.from({ length: 24 }).map(function (v, i) { return { id: i, name: (i < 10 ? '0' : '') + i + ':00' }; });
function getColor(numOfSteps, step) {
const deg = 360/numOfSteps;
return `hsl(${deg*step} 70% 50%)`;
}
// named exports
export {
prettyRelayProviderName,
@@ -686,7 +691,8 @@ export {
getDataURLFromFile,
getTextFromFile,
cronDays,
cronHours
cronHours,
getColor,
};
// default export
@@ -704,5 +710,6 @@ export default {
getDataURLFromFile,
getTextFromFile,
cronDays,
cronHours
cronHours,
getColor,
};