diff options
author | Neil <nyamatongwe@gmail.com> | 2023-10-10 09:11:27 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2023-10-10 09:11:27 +1100 |
commit | b20c3b551a4a87888cf00e5f7da22d836015a073 (patch) | |
tree | 4c2f9fd038f52c0b09c322f2f21d444766ad1994 /src/ViewStyle.cxx | |
parent | 74876d72fdd85764ecc0a231bdaa711498178df5 (diff) | |
download | scintilla-mirror-b20c3b551a4a87888cf00e5f7da22d836015a073.tar.gz |
Use global constants for opaque black and white and local constants for greys.
Makes it easier to understand and reduces warnings.
Diffstat (limited to 'src/ViewStyle.cxx')
-rw-r--r-- | src/ViewStyle.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index b8fe0c0d6..a669fce4a 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -186,10 +186,10 @@ ViewStyle::ViewStyle(size_t stylesSize_) : controlCharWidth = 0; selbar = Platform::Chrome(); selbarlight = Platform::ChromeHighlight(); - styles[StyleLineNumber].fore = ColourRGBA(0, 0, 0); + styles[StyleLineNumber].fore = black; styles[StyleLineNumber].back = Platform::Chrome(); - elementBaseColours[Element::Caret] = ColourRGBA(0, 0, 0); + elementBaseColours[Element::Caret] = black; elementBaseColours[Element::CaretAdditional] = ColourRGBA(0x7f, 0x7f, 0x7f); elementAllowsTranslucent.insert({ Element::Caret, @@ -459,7 +459,7 @@ void ViewStyle::ClearStyles() { styles[StyleLineNumber].back = Platform::Chrome(); // Set call tip fore/back to match the values previously set for call tips - styles[StyleCallTip].back = ColourRGBA(0xff, 0xff, 0xff); + styles[StyleCallTip].back = white; styles[StyleCallTip].fore = ColourRGBA(0x80, 0x80, 0x80); } @@ -622,8 +622,7 @@ ColourRGBA ViewStyle::ElementColourForced(Element element) const { // This method avoids warnings for unwrapping potentially empty optionals from // Visual C++ Code Analysis const ColourOptional colour = ElementColour(element); - constexpr ColourRGBA opaqueBlack(0, 0, 0, 0xff); - return colour.value_or(opaqueBlack); + return colour.value_or(black); } bool ViewStyle::ElementAllowsTranslucent(Element element) const { |