darker colors for cam
This commit is contained in:
parent
305551a60c
commit
7b72464fdf
2 changed files with 9 additions and 12 deletions
|
|
@ -126,12 +126,14 @@ KIRI.worker = {
|
||||||
send.data({ progress, message });
|
send.data({ progress, message });
|
||||||
});
|
});
|
||||||
|
|
||||||
const maxSpeed = (current.print || {}).maxSpeed || undefined;
|
const print = current.print || {};
|
||||||
|
const maxSpeed = print.maxSpeed || undefined;
|
||||||
|
const thinColor = print.thinColor || false;
|
||||||
let speedColors = {};
|
let speedColors = {};
|
||||||
if (maxSpeed) {
|
if (maxSpeed) {
|
||||||
const FDM = KIRI.driver.FDM;
|
const FDM = KIRI.driver.FDM;
|
||||||
for (let i=0, sd=maxSpeed/19, so=0; i<20; i++) {
|
for (let i=0, sd=maxSpeed/19, so=0; i<20; i++) {
|
||||||
speedColors[Math.round(so)] = FDM.colorFunc(so/(maxSpeed+1));
|
speedColors[Math.round(so)] = FDM.rateToColor(so, maxSpeed + 1, thinColor);
|
||||||
so += sd;
|
so += sd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -397,8 +397,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FDM.colorFunc = function(rate) {
|
FDM.rateToColor = function(rate, max, ext) {
|
||||||
return hsv2rgb({h: rate, s:1, v:0.8});
|
return hsv2rgb({h: rate/max, s:1, v:ext ? 0.7 : 0.8}, ext);
|
||||||
};
|
};
|
||||||
|
|
||||||
FDM.prepareRender = function(levels, update, options) {
|
FDM.prepareRender = function(levels, update, options) {
|
||||||
|
|
@ -421,20 +421,15 @@
|
||||||
|
|
||||||
// for reporting
|
// for reporting
|
||||||
self.worker.print.maxSpeed = maxspd - 1;
|
self.worker.print.maxSpeed = maxspd - 1;
|
||||||
|
self.worker.print.thinColor = thin;
|
||||||
|
|
||||||
let lastOut = null;
|
let lastOut = null;
|
||||||
let current = null;
|
let current = null;
|
||||||
|
|
||||||
function colorDefault(point) {
|
function color(point) {
|
||||||
return hsv2rgb({h:point.speed / maxspd, s:1, v:0.75});
|
return FDM.rateToColor(point.speed, maxspd, thin);
|
||||||
}
|
}
|
||||||
|
|
||||||
function colorCustom(point) {
|
|
||||||
return FDM.rateToColor(point.speed, maxspd);
|
|
||||||
}
|
|
||||||
|
|
||||||
const color = FDM.rateToColor ? colorCustom : colorDefault;
|
|
||||||
|
|
||||||
levels.forEach((level, index) => {
|
levels.forEach((level, index) => {
|
||||||
const prints = {};
|
const prints = {};
|
||||||
const moves = [];
|
const moves = [];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue