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 } |