add colorblind setting and friendly palettes

- mode applies to plot data, plot background color, statsseries colors, roofline timescale
This commit is contained in:
Christoph Kluge
2025-01-14 17:40:25 +01:00
parent 42e8e37bd4
commit 736236e9ca
5 changed files with 125 additions and 16 deletions

View File

@@ -40,6 +40,7 @@
let timeoutId = null;
const lineWidth = clusterCockpitConfig.plot_general_lineWidth;
const cbmode = clusterCockpitConfig?.plot_general_colorblindMode || false;
// Helpers
function getGradientR(x) {
@@ -61,7 +62,7 @@
return Math.floor(x * 255.0);
}
function getRGB(c) {
return `rgb(${getGradientR(c)}, ${getGradientG(c)}, ${getGradientB(c)})`;
return `rgb(${cbmode ? '0' : getGradientR(c)}, ${getGradientG(c)}, ${getGradientB(c)})`;
}
function nearestThousand(num) {
return Math.ceil(num / 1000) * 1000;