mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Merge branch 'accessibility-color-blind' of https://github.com/David-Brenn/anki into accessibility-color-blind
This commit is contained in:
commit
2e339b7557
1 changed files with 5 additions and 3 deletions
|
@ -16,7 +16,7 @@ import {
|
||||||
axisRight,
|
axisRight,
|
||||||
curveBasis,
|
curveBasis,
|
||||||
interpolateBlues,
|
interpolateBlues,
|
||||||
interpolatePurples,
|
interpolateViridis,
|
||||||
pointer,
|
pointer,
|
||||||
scaleBand,
|
scaleBand,
|
||||||
scaleLinear,
|
scaleLinear,
|
||||||
|
@ -84,16 +84,18 @@ export function renderHours(
|
||||||
.classed(oddTickClass, (d: any): boolean => d % 2 != 0)
|
.classed(oddTickClass, (d: any): boolean => d % 2 != 0)
|
||||||
.attr("direction", "ltr");
|
.attr("direction", "ltr");
|
||||||
|
|
||||||
let cappedRange = scaleLinear().range([0.1, 0.8]);
|
let cappedRange;
|
||||||
let colour;
|
let colour;
|
||||||
const isColorBlindMode = (window as any).colorBlindMode;
|
const isColorBlindMode = (window as any).colorBlindMode;
|
||||||
|
|
||||||
if(isColorBlindMode) {
|
if(isColorBlindMode) {
|
||||||
colour = scaleSequential((n) => interpolatePurples(cappedRange(n)!)).domain([
|
cappedRange = scaleLinear().range([0.0, 1]);
|
||||||
|
colour = scaleSequential((n) => interpolateViridis(cappedRange(n)!)).domain([
|
||||||
0,
|
0,
|
||||||
yMax,
|
yMax,
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
|
cappedRange = scaleLinear().range([0.1, 0.8]);
|
||||||
colour = scaleSequential((n) => interpolateBlues(cappedRange(n)!)).domain([
|
colour = scaleSequential((n) => interpolateBlues(cappedRange(n)!)).domain([
|
||||||
0,
|
0,
|
||||||
yMax,
|
yMax,
|
||||||
|
|
Loading…
Reference in a new issue