Update heatglow.js
This commit is contained in:
parent
bc2067e84a
commit
bbac548190
|
|
@ -1,11 +1,11 @@
|
||||||
const heatfunc = function(pixel){
|
const heatfunc = function(pixel){
|
||||||
pixel.gethigh = (elements[pixel.element].tempHigh)
|
if (pixel.ogR == null || pixel.ogG == null || pixel.ogB == null){
|
||||||
pixel.halftemp = ((20+pixel.gethigh)/2)
|
|
||||||
if (!pixel.ogR || !pixel.ogG || !pixel.ogB){
|
|
||||||
pixel.ogR = parseInt(pixel.color.slice(4, pixel.color.indexOf(',')), 10)
|
pixel.ogR = parseInt(pixel.color.slice(4, pixel.color.indexOf(',')), 10)
|
||||||
pixel.ogG = parseInt(pixel.color.slice(pixel.color.indexOf(',') + 1, pixel.color.lastIndexOf(',')), 10)
|
pixel.ogG = parseInt(pixel.color.slice(pixel.color.indexOf(',') + 1, pixel.color.lastIndexOf(',')), 10)
|
||||||
pixel.ogB = parseInt(pixel.color.slice(pixel.color.lastIndexOf(',') + 1, -1), 10)
|
pixel.ogB = parseInt(pixel.color.slice(pixel.color.lastIndexOf(',') + 1, -1), 10)
|
||||||
}else if (pixelTicks > pixel.start){
|
}else{
|
||||||
|
pixel.gethigh = (elements[pixel.element].tempHigh)
|
||||||
|
pixel.halftemp = ((20+pixel.gethigh)/2)
|
||||||
if (pixel.temp <= (pixel.gethigh) - pixel.halftemp){
|
if (pixel.temp <= (pixel.gethigh) - pixel.halftemp){
|
||||||
pixel.ctemp = 0;
|
pixel.ctemp = 0;
|
||||||
} else if (pixel.temp > (pixel.gethigh)-pixel.halftemp && pixel.temp <= pixel.gethigh){
|
} else if (pixel.temp > (pixel.gethigh)-pixel.halftemp && pixel.temp <= pixel.gethigh){
|
||||||
|
|
@ -17,7 +17,7 @@ const heatfunc = function(pixel){
|
||||||
pixel.newB = ((0-((2*pixel.ogB)*pixel.ctemp))+pixel.ogB);
|
pixel.newB = ((0-((2*pixel.ogB)*pixel.ctemp))+pixel.ogB);
|
||||||
}else if (pixel.ctemp > 0.5){
|
}else if (pixel.ctemp > 0.5){
|
||||||
pixel.newR = 255;
|
pixel.newR = 255;
|
||||||
pixel.newG = ((510*pixel.ctemp)-256);
|
pixel.newG = ((510*pixel.ctemp)-255);
|
||||||
pixel.newB= ((280*pixel.ctemp)-140);
|
pixel.newB= ((280*pixel.ctemp)-140);
|
||||||
}
|
}
|
||||||
pixel.color = "rgb(" + pixel.newR + "," + pixel.newG + "," + pixel.newB + ")";
|
pixel.color = "rgb(" + pixel.newR + "," + pixel.newG + "," + pixel.newB + ")";
|
||||||
|
|
@ -36,3 +36,14 @@ metals.forEach(metal => {
|
||||||
elements[metal].tick = modfunc;
|
elements[metal].tick = modfunc;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
elements.color_baker = {
|
||||||
|
color: "#F61212",
|
||||||
|
tool: function(pixel) {
|
||||||
|
pixel.ogR = parseInt(pixel.color.slice(4, pixel.color.indexOf(',')), 10)
|
||||||
|
pixel.ogG = parseInt(pixel.color.slice(pixel.color.indexOf(',') + 1, pixel.color.lastIndexOf(',')), 10)
|
||||||
|
pixel.ogB = parseInt(pixel.color.slice(pixel.color.lastIndexOf(',') + 1, -1), 10)
|
||||||
|
},
|
||||||
|
category: "tools",
|
||||||
|
excludeRandom: true,
|
||||||
|
desc: "Use to bake a metals paint color into its 'true' color, for heating purposes.",
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue