MCPcopy Create free account
hub / github.com/devforth/painterro / reversedColor

Function reversedColor

js/colorPicker.js:37–41  ·  view source on GitHub ↗
(color)

Source from the content-addressed store, hash-verified

35}
36
37function reversedColor(color) {
38 const rgb = HexToRGB(color);
39 const index = ((rgb.r * 299) + (rgb.g * 587) + (rgb.b * 114)) / 1000;
40 return (index >= 128 && 'black') || 'white';
41}
42
43export default class ColorPicker {
44 constructor(main, callback) {

Callers 1

setActiveColorMethod · 0.85

Calls 1

HexToRGBFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…