Add vertex finder feature.

This commit is contained in:
Oleg Sh
2025-06-15 15:52:55 +02:00
parent 54e58c8011
commit 2bc0bda130
26 changed files with 249 additions and 24 deletions

View File

@@ -54,4 +54,19 @@ Array.prototype.swap = function (x, y) {
this[x] = this[y];
this[y] = b;
return this;
}
function InvertColor(hex) {
// Remove '#' if present
hex = hex.replace(/^#/, '');
// Parse r, g, b values
let r = 255 - parseInt(hex.slice(0, 2), 16);
let g = 255 - parseInt(hex.slice(2, 4), 16);
let b = 255 - parseInt(hex.slice(4, 6), 16);
// Convert back to hex and pad with 0s if necessary
const toHex = (n) => n.toString(16).padStart(2, '0');
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
}