aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/EditView.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2023-10-10 09:11:27 +1100
committerNeil <nyamatongwe@gmail.com>2023-10-10 09:11:27 +1100
commitb20c3b551a4a87888cf00e5f7da22d836015a073 (patch)
tree4c2f9fd038f52c0b09c322f2f21d444766ad1994 /src/EditView.cxx
parent74876d72fdd85764ecc0a231bdaa711498178df5 (diff)
downloadscintilla-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/EditView.cxx')
-rw-r--r--src/EditView.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx
index 09a20eda3..8f413e963 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -2093,7 +2093,7 @@ ColourRGBA InvertedLight(ColourRGBA orig) noexcept {
const unsigned int l = (r + g + b) / 3; // There is a better calculation for this that matches human eye
const unsigned int il = 0xff - l;
if (l == 0)
- return ColourRGBA(0xff, 0xff, 0xff);
+ return white;
r = r * il / l;
g = g * il / l;
b = b * il / l;
@@ -2714,15 +2714,15 @@ Sci::Position EditView::FormatRange(bool draw, CharacterRangeFull chrg, Rectangl
it->fore = InvertedLight(it->fore);
it->back = InvertedLight(it->back);
} else if (colourMode == PrintOption::BlackOnWhite) {
- it->fore = ColourRGBA(0, 0, 0);
- it->back = ColourRGBA(0xff, 0xff, 0xff);
+ it->fore = black;
+ it->back = white;
} else if (colourMode == PrintOption::ColourOnWhite || colourMode == PrintOption::ColourOnWhiteDefaultBG) {
- it->back = ColourRGBA(0xff, 0xff, 0xff);
+ it->back = white;
}
}
// White background for the line numbers if PrintOption::ScreenColours isn't used
if (colourMode != PrintOption::ScreenColours) {
- vsPrint.styles[StyleLineNumber].back = ColourRGBA(0xff, 0xff, 0xff);
+ vsPrint.styles[StyleLineNumber].back = white;
}
// Printing uses different margins, so reset screen margins