From: Vsevolod Stakhov Date: Thu, 29 Jul 2021 11:59:22 +0000 (+0100) Subject: [Minor] Fix transparency parsing X-Git-Tag: 3.0~81 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3206cbd412877e47d60e24eaabc469d230fc11df;p=rspamd.git [Minor] Fix transparency parsing --- diff --git a/src/libserver/css/css_value.cxx b/src/libserver/css/css_value.cxx index 704905cd4..6982647f4 100644 --- a/src/libserver/css/css_value.cxx +++ b/src/libserver/css/css_value.cxx @@ -147,14 +147,14 @@ constexpr static inline auto alpha_component_convert(const css_parser_token &tok ret = (dbl / 100.0); } else { - if (dbl > 255) { - dbl = 255; + if (dbl > 1.0) { + dbl = 1.0; } else if (dbl < 0) { dbl = 0; } - ret = dbl / 255.0; + ret = dbl; } }