diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-07 14:30:22 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-07 14:30:22 +0100 |
commit | 0aaf6ac2c1e8aaf9fe53a64cbb5ec06586fa9ccd (patch) | |
tree | 4068b63db6787b798d6def34371c39efc79d671e /src/libserver/css/css_value.cxx | |
parent | dc0d54237944801b29d509dd3fcb8ef9940f86fe (diff) | |
download | rspamd-0aaf6ac2c1e8aaf9fe53a64cbb5ec06586fa9ccd.tar.gz rspamd-0aaf6ac2c1e8aaf9fe53a64cbb5ec06586fa9ccd.zip |
[Minor] Css: Fix colors parsing
Diffstat (limited to 'src/libserver/css/css_value.cxx')
-rw-r--r-- | src/libserver/css/css_value.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libserver/css/css_value.cxx b/src/libserver/css/css_value.cxx index ec44b86a6..799d5f8ef 100644 --- a/src/libserver/css/css_value.cxx +++ b/src/libserver/css/css_value.cxx @@ -110,14 +110,14 @@ constexpr static inline auto rgb_color_component_convert(const css_parser_token ret = (std::uint8_t) (dbl / 100.0 * 255.0); } else { - if (dbl > 1) { - dbl = 1; + if (dbl > 255) { + dbl = 255; } else if (dbl < 0) { dbl = 0; } - ret = (std::uint8_t) (dbl * 255.0); + ret = (std::uint8_t) (dbl); } } |