Merge branch 'mdev' into dmx_input

This commit is contained in:
Will Tatam
2024-02-10 17:10:15 +00:00
28 changed files with 2719 additions and 2238 deletions

View File

@@ -675,11 +675,11 @@ function populateInfo(i)
if (i.cn) vcn = i.cn;
//WLEDMM: add total heap and total PSRAM, and build number, add bin name
if (i.ver.includes("0.14.1")) vcn = "Sitting Ducks"; // easter egg
if (i.ver.includes("0.14.0")) vcn = "Lupo"; // check for MM versioning scheme
if (i.ver.includes("0.14.0-b15")) vcn = "Sitting Ducks"; // late easter egg
if (i.ver.includes("0.14.0-b2")) vcn = "This is the way"; // recently watched The Mandalorian? I have spoken ;-)
if (i.ver.includes("0.14.0-b15.22")) vcn = "Lupo";
if (i.ver.includes("0.14.1-b3")) vcn = "Fried Chicken"; // final line of "One Vision" by Queen
cn += `v${i.ver} &nbsp;<i>"${vcn}"</i><p>(WLEDMM_${i.ver} ${i.rel}.bin)</p><p><em>build ${i.vid}</em></p><table>
${urows}
${urows===""?'':'<tr><td colspan=2><hr style="height:1px;border-width:0;color:SeaGreen;background-color:Seagreen"></td></tr>'}
@@ -977,6 +977,11 @@ function redrawPalPrev()
}
}
// WLEDMM experimental - revert gamma correction in the browser (for palette preview)
function unGamma(val, gamma){
return Math.round(Math.pow(val / 255.0, 1.0/gamma) * 255.0);
}
function genPalPrevCss(id)
{
if (!palettesData) return;
@@ -999,15 +1004,17 @@ function genPalPrevCss(id)
let r, g, b;
let index = false;
if (Array.isArray(e)) {
// fastLED palettes, with gammas (2.6, 2.2, 2.5) - we revert with slightly reduced values, to better preserve contrast
index = Math.round(e[0]/255*100);
r = e[1];
g = e[2];
b = e[3];
r = unGamma(e[1], 2.5);
g = unGamma(e[2], 2.3);
b = unGamma(e[3], 2.4);
} else if (e == 'r') {
r = Math.random() * 255;
g = Math.random() * 255;
b = Math.random() * 255;
} else {
// gradient palettes have custom gamma ~2.6 - don't revert, so their look matches the custom colors display
let i = e[1] - 1;
var cd = gId('csl').children;
r = parseInt(cd[i].dataset.r);