diff options
Diffstat (limited to 'win32/PlatWin.cxx')
-rw-r--r-- | win32/PlatWin.cxx | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 3e966b4d3..c4f08b798 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -865,18 +865,6 @@ void DIBSection::SetSymmetric(LONG x, LONG y, DWORD value) noexcept { SetPixel(xSymmetric, ySymmetric, value); } -constexpr unsigned int Proportional(unsigned char a, unsigned char b, XYPOSITION t) noexcept { - return static_cast<unsigned int>(a + t * (b - a)); -} - -ColourRGBA Proportional(ColourRGBA a, ColourRGBA b, XYPOSITION t) noexcept { - return ColourRGBA( - Proportional(a.GetRed(), b.GetRed(), t), - Proportional(a.GetGreen(), b.GetGreen(), t), - Proportional(a.GetBlue(), b.GetBlue(), t), - Proportional(a.GetAlpha(), b.GetAlpha(), t)); -} - ColourRGBA GradientValue(const std::vector<ColourStop> &stops, XYPOSITION proportion) noexcept { for (size_t stop = 0; stop < stops.size() - 1; stop++) { // Loop through each pair of stops @@ -885,7 +873,7 @@ ColourRGBA GradientValue(const std::vector<ColourStop> &stops, XYPOSITION propor if ((proportion >= positionStart) && (proportion <= positionEnd)) { const XYPOSITION proportionInPair = (proportion - positionStart) / (positionEnd - positionStart); - return Proportional(stops[stop].colour, stops[stop + 1].colour, proportionInPair); + return stops[stop].colour.MixedWith(stops[stop + 1].colour, proportionInPair); } } // Loop should always find a value |