@marc
I have now added the following code (using your linked repository as a guide):
auto ConvertColorRefToColorAlpha = [](COLORREF color, uint8_t alpha = 255) -> uint32_t {
// Extract RGB components from the COLORREF value
const uint8_t red = GetRValue(color);
const uint8_t green = GetGValue(color);
const uint8_t blue = GetBValue(color);
// Combine into ARGB format
const uint32_t coloralpha = (alpha << 24) | (blue << 16) | (green << 8) | red;
return coloralpha;
};
// Retrieve the system highlight color
const auto highlightColor = ConvertColorRefToColorAlpha(::GetSysColor(COLOR_HIGHLIGHT));
// Retrieve the system highlight text color
const auto highlightTextColor = ConvertColorRefToColorAlpha(::GetSysColor(COLOR_HIGHLIGHTTEXT));
m_edit.SetSelectionLayer(Scintilla::Layer::UnderText);
m_edit.SetElementColour(Scintilla::Element::SelectionText, highlightTextColor);
m_edit.SetElementColour(Scintilla::Element::SelectionBack, highlightColor);
m_edit.SetElementColour(Scintilla::Element::SelectionAdditionalBack, highlightColor);
m_edit.SetElementColour(Scintilla::Element::SelectionSecondaryBack, highlightColor);
m_edit.SetElementColour(Scintilla::Element::SelectionInactiveBack, highlightColor);
This does appear better:
But, I am still not sure about the way I have used highlightTextColor.