src/colors.cpp

changeset 250
2837b549e616
parent 205
1a4342d80de7
child 259
c27612f0eac0
equal deleted inserted replaced
249:37d3c819cafa 250:2837b549e616
106 //! @brief Returns an edge color for @param color, taking direct colors into account 106 //! @brief Returns an edge color for @param color, taking direct colors into account
107 std::optional<QColor> colorEdge(ColorIndex color, const ColorTable& colorTable) 107 std::optional<QColor> colorEdge(ColorIndex color, const ColorTable& colorTable)
108 { 108 {
109 if (isDirectColor(color)) { 109 if (isDirectColor(color)) {
110 const std::array<int, 3> rgb = directColorRgb(color); 110 const std::array<int, 3> rgb = directColorRgb(color);
111 return (luma(rgb[0], rgb[1], rgb[2]) < 0.4) ? Qt::white : Qt::black; 111 return (luma(rgb[0], rgb[1], rgb[2]) < 102) ? Qt::white : Qt::black;
112 } 112 }
113 else { 113 else {
114 return colorFace(color, colorTable); 114 return colorFace(color, colorTable);
115 } 115 }
116 } 116 }

mercurial