MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / hueCounts

Function hueCounts

graph-ui/tools/handtest-fixes-architecture.mjs:142–152  ·  view source on GitHub ↗

* Bildpunkte in einem Rechteck (CSS-Pixel), deren staerkster Kanal deutlich * Blau ist, wie die geteilte CALLS-Farbe #579fc7 oder das Blaugrau #85b4c5 * der aus Quelltext gebauten Dienste, und solche, die deutlich * gruen sind wie die Aufruffarbe der Palette.

(image, rect)

Source from the content-addressed store, hash-verified

140 * gruen sind wie die Aufruffarbe der Palette.
141 */
142function hueCounts(image, rect) {
143 let blue = 0; let green = 0;
144 for (let y = Math.max(0, Math.round(rect.top * SCALE)); y < Math.min(image.height, Math.round(rect.bottom * SCALE)); y++) {
145 for (let x = Math.max(0, Math.round(rect.left * SCALE)); x < Math.min(image.width, Math.round(rect.right * SCALE)); x++) {
146 const at = (y * image.width + x) * image.channels; const r = image.pixels[at]; const g = image.pixels[at + 1]; const b = image.pixels[at + 2];
147 if (b - g >= 12 && b - r >= 40) blue += 1;
148 if (g - b >= 25 && g - r >= 60) green += 1;
149 }
150 }
151 return { blue, green };
152}
153
154/* ------------------------------------------------------------------ */
155/* Seite */

Callers 1

k19LinesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected