MCPcopy Create free account
hub / github.com/abreheret/PixelAnnotationTool / readableColor

Function readableColor

src/utils.cpp:50–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50QColor readableColor(const QColor & color)
51{
52 int r, g, b;
53 color.getRgb(&r, &g, &b);
54
55 if ((r*0.299 + g*0.587 + b*0.114) > 150)
56 return QColor(0, 0, 0);
57
58 return QColor(255, 255, 255);
59
60}
61QColor invColor(const QColor& color) {
62 int h, s, v;
63 color.getHsv(&h, &s, &v);

Callers 1

setNewLabelMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected