1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 17:15:08 +00:00

LibWeb: Use llroundf() when rounding floats

This commit is contained in:
Sam Atkins 2022-09-10 12:51:09 +01:00 committed by Andreas Kling
parent 188d9f1326
commit a211c06e99

View file

@ -3322,9 +3322,9 @@ Optional<Color> Parser::parse_rgb_or_hsl_color(StringView function_name, Vector<
&& params[1].is(Token::Type::Number)
&& params[2].is(Token::Type::Number)) {
u8 r_val = clamp(llround(params[0].number_value()), 0, 255);
u8 g_val = clamp(llround(params[1].number_value()), 0, 255);
u8 b_val = clamp(llround(params[2].number_value()), 0, 255);
u8 r_val = clamp(llroundf(params[0].number_value()), 0, 255);
u8 g_val = clamp(llroundf(params[1].number_value()), 0, 255);
u8 b_val = clamp(llroundf(params[2].number_value()), 0, 255);
return Color(r_val, g_val, b_val, a_val);
}