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

Function getContrastColor

web/js/main.js:871–874  ·  view source on GitHub ↗
(r, g, b)

Source from the content-addressed store, hash-verified

869}
870
871function getContrastColor(r, g, b) {
872 const yiq = (r * 299 + g * 587 + b * 114) / 1000;
873 return yiq >= 150 ? '#000000' : '#FFFFFF';
874}
875
876function extract1x1Grid(imageData, blockSize) {
877 const src = imageData.data;

Callers 1

renderBeadPatternFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected