MCPcopy Create free account
hub / github.com/32comic/image2pixel-web / extractShortCode

Function extractShortCode

web/js/main.js:861–869  ·  view source on GitHub ↗
(fullCode)

Source from the content-addressed store, hash-verified

859}
860
861function extractShortCode(fullCode) {
862 if (!fullCode) return '';
863 // Extract numeric part after letter prefix (P01→1, H01→1, S199→199)
864 const match = fullCode.match(/([A-Za-z]*)(\d+)/);
865 if (match) {
866 return String(parseInt(match[2], 10));
867 }
868 return fullCode;
869}
870
871function getContrastColor(r, g, b) {
872 const yiq = (r * 299 + g * 587 + b * 114) / 1000;

Callers 1

renderBeadPatternFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected