diff options
author | Neil <nyamatongwe@gmail.com> | 2021-06-09 12:15:05 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-06-09 12:15:05 +1000 |
commit | b5e8caaacbd47583c79bf862e5e6a021bcfc3964 (patch) | |
tree | 885ceb140cda8f9721ddeb3a327c5a51e27e3785 /src/Geometry.h | |
parent | 5f998b68113dd116c1e938028dddcbcc7425a144 (diff) | |
download | scintilla-mirror-b5e8caaacbd47583c79bf862e5e6a021bcfc3964.tar.gz |
Reduce casts by defining methods for common conversions.
Diffstat (limited to 'src/Geometry.h')
-rw-r--r-- | src/Geometry.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Geometry.h b/src/Geometry.h index e471bdfc0..6456af0e8 100644 --- a/src/Geometry.h +++ b/src/Geometry.h @@ -180,6 +180,10 @@ public: return ColourRGBA(co_ | (0xffu << 24)); } + static constexpr ColourRGBA FromIpRGB(intptr_t co_) noexcept { + return ColourRGBA(static_cast<int>(co_) | (0xffu << 24)); + } + constexpr ColourRGBA WithoutAlpha() const noexcept { return ColourRGBA(co & 0xffffff); } |