From b20c3b551a4a87888cf00e5f7da22d836015a073 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 10 Oct 2023 09:11:27 +1100 Subject: Use global constants for opaque black and white and local constants for greys. Makes it easier to understand and reduces warnings. --- src/EditView.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/EditView.cxx') 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 -- cgit v1.2.3