Spaces:
Build error
Build error
Update static/js/script.js
Browse files- static/js/script.js +7 -7
static/js/script.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
let hsv = { hMin: 0, hMax:
|
| 2 |
|
| 3 |
function uploadPDF() {
|
| 4 |
const file = document.getElementById('fileInput').files[0];
|
|
@@ -53,14 +53,14 @@ function updateHSVLabels() {
|
|
| 53 |
|
| 54 |
function adjust(component, delta) {
|
| 55 |
if (component === 'h') {
|
| 56 |
-
hsv.hMin = Math.max(0, hsv.hMin);
|
| 57 |
-
hsv.hMax = Math.min(179, hsv.hMax);
|
| 58 |
} else if (component === 's') {
|
| 59 |
-
hsv.sMin = Math.max(0, hsv.sMin);
|
| 60 |
-
hsv.sMax = Math.min(255, hsv.sMax);
|
| 61 |
} else if (component === 'v') {
|
| 62 |
-
hsv.vMin = Math.max(0, hsv.vMin);
|
| 63 |
-
hsv.vMax = Math.min(255, hsv.vMax);
|
| 64 |
}
|
| 65 |
updateHSVLabels();
|
| 66 |
updateMask();
|
|
|
|
| 1 |
+
let hsv = { hMin: 0, hMax: 0, sMin: 0, sMax: 0, vMin: 0, vMax: 0 };
|
| 2 |
|
| 3 |
function uploadPDF() {
|
| 4 |
const file = document.getElementById('fileInput').files[0];
|
|
|
|
| 53 |
|
| 54 |
function adjust(component, delta) {
|
| 55 |
if (component === 'h') {
|
| 56 |
+
hsv.hMin = Math.max(0, hsv.hMin + delta);
|
| 57 |
+
hsv.hMax = Math.min(179, hsv.hMax + delta);
|
| 58 |
} else if (component === 's') {
|
| 59 |
+
hsv.sMin = Math.max(0, hsv.sMin + delta);
|
| 60 |
+
hsv.sMax = Math.min(255, hsv.sMax + delta);
|
| 61 |
} else if (component === 'v') {
|
| 62 |
+
hsv.vMin = Math.max(0, hsv.vMin + delta);
|
| 63 |
+
hsv.vMax = Math.min(255, hsv.vMax + delta);
|
| 64 |
}
|
| 65 |
updateHSVLabels();
|
| 66 |
updateMask();
|