add ability to provide custom preview colorizer

This commit is contained in:
Stewart Allen 2020-11-10 15:46:37 -05:00
commit 48e43f1a98

View file

@ -413,10 +413,16 @@
let lastOut = null;
let current = null;
function color(point) {
function colorDefault(point) {
return hsv2rgb({h:point.speed / maxspd, s:1, v:0.75}, true);
}
function colorCustom(point) {
return FDM.rateToColor(point.speed, maxspd);
}
const color = FDM.rateToColor ? colorCustom : colorDefault;
levels.forEach((level, index) => {
const prints = {};
const moves = [];