commit b1a4761: [Minor] Add conversion to rgb without alpha channel
Vsevolod Stakhov
vsevolod at highsecure.ru
Mon Jun 14 13:14:04 UTC 2021
Author: Vsevolod Stakhov
Date: 2021-06-14 13:21:20 +0100
URL: https://github.com/rspamd/rspamd/commit/b1a47611bedc66ce0bd26efd1ff5cee720f6aeac
[Minor] Add conversion to rgb without alpha channel
---
src/libserver/css/css_value.hxx | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/libserver/css/css_value.hxx b/src/libserver/css/css_value.hxx
index a7b9a9b47..efb18e20a 100644
--- a/src/libserver/css/css_value.hxx
+++ b/src/libserver/css/css_value.hxx
@@ -46,6 +46,12 @@ struct alignas(int) css_color {
(std::uint32_t)g << 8 |
(std::uint32_t)b << 0;
}
+
+ constexpr auto to_rgb() const -> std::uint32_t {
+ return (std::uint32_t)r << 16 |
+ (std::uint32_t)g << 8 |
+ (std::uint32_t)b << 0;
+ }
friend bool operator==(const css_color& l, const css_color& r) {
return (memcmp(&l, &r, sizeof(css_color)) == 0);
}
More information about the Commits
mailing list