diff --git a/ts/routes/graphs/TrueRetentionCombined.svelte b/ts/routes/graphs/TrueRetentionCombined.svelte index 5a9efc814..cf57e80e1 100644 --- a/ts/routes/graphs/TrueRetentionCombined.svelte +++ b/ts/routes/graphs/TrueRetentionCombined.svelte @@ -5,7 +5,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html @@ -84,11 +99,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html } .young { - color: #64c476; + color: var(--young-color); } .mature { - color: #31a354; + color: var(--mature-color); } .total { diff --git a/ts/routes/graphs/TrueRetentionSingle.svelte b/ts/routes/graphs/TrueRetentionSingle.svelte index 9199717f8..b0765b10a 100644 --- a/ts/routes/graphs/TrueRetentionSingle.svelte +++ b/ts/routes/graphs/TrueRetentionSingle.svelte @@ -1,7 +1,3 @@ -
@@ -71,11 +82,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html } .pass { - color: #3bc464; + color: var(--pass-color); } .fail { - color: #c43b3b; + color: var(--fail-color); } .retention { diff --git a/ts/routes/graphs/hours.ts b/ts/routes/graphs/hours.ts index 3f3b07771..fde217927 100644 --- a/ts/routes/graphs/hours.ts +++ b/ts/routes/graphs/hours.ts @@ -16,6 +16,7 @@ import { axisRight, curveBasis, interpolateBlues, + interpolatePurples, pointer, scaleBand, scaleLinear, @@ -83,11 +84,21 @@ export function renderHours( .classed(oddTickClass, (d: any): boolean => d % 2 != 0) .attr("direction", "ltr"); - const cappedRange = scaleLinear().range([0.1, 0.8]); - const colour = scaleSequential((n) => interpolateBlues(cappedRange(n)!)).domain([ - 0, - yMax, - ]); + let cappedRange = scaleLinear().range([0.1, 0.8]); + let colour; + const isColorBlindMode = (window as any).colorBlindMode; + + if(isColorBlindMode) { + colour = scaleSequential((n) => interpolatePurples(cappedRange(n)!)).domain([ + 0, + yMax, + ]); + } else { + colour = scaleSequential((n) => interpolateBlues(cappedRange(n)!)).domain([ + 0, + yMax, + ]); + } // y scale const yTickFormat = (n: number): string => localizedNumber(n);