From 818939e0659844698608f2afd16e8410e9fe5ca0 Mon Sep 17 00:00:00 2001 From: DylanSpeiser Date: Wed, 3 Jul 2024 15:09:23 -0700 Subject: [PATCH] math? --- web-ui.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/web-ui.js b/web-ui.js index 0e3f2e0..e77e6f7 100644 --- a/web-ui.js +++ b/web-ui.js @@ -562,14 +562,19 @@ function setCCFromUI(which) { cameras[ci].PUTdata("/colorCorrection/offset", ccobject); } else if (which == 4) { let pivotFloat = parseFloat(document.getElementById("CCcontrastPivotLabel").innerHTML); - let adjustFloat = parseInt(document.getElementById("CCcontrastAdjustLabel").innerHTML); + let adjustInt = parseInt(document.getElementById("CCcontrastAdjustLabel").innerHTML); + let adjustFloat = adjustInt/50; + cameras[ci].PUTdata("/colorCorrection/contrast", {pivot: pivotFloat, adjust: adjustFloat}); } else { - let hueFloat = parseInt(document.getElementById("CCcolorHueLabel").innerHTML); - let satFloat = parseInt(document.getElementById("CCcolorSatLabel").innerHTML); - let lumCoFloat = parseInt(document.getElementById("CCcolorLCLabel").innerHTML); + let hueInt = parseInt(document.getElementById("CCcolorHueLabel").innerHTML); + let satInt = parseInt(document.getElementById("CCcolorSatLabel").innerHTML); + let lumCoInt = parseInt(document.getElementById("CCcolorLCLabel").innerHTML); + let hueFloat = (hueInt/180) - 1.0; + let satFloat = satInt/50; + let lumCoFloat = lumCoInt/50; cameras[ci].PUTdata("/colorCorrection/color", {hue: hueFloat, saturation: satFloat}); cameras[ci].PUTdata("/colorCorrection/lumaContribution", {lumaContribution: lumCoFloat});