LibWeb: Explicitly cast parameters to Color::from_hsl/hsla()

CLion was giving me the angry red underlines about this.
This commit is contained in:
Sam Atkins 2021-10-23 13:07:47 +01:00 committed by Andreas Kling
parent 21b65de1ec
commit d1f489b847

View file

@ -2214,7 +2214,7 @@ Optional<Color> Parser::parse_color(ParsingContext const&, StyleComponentValueRu
float h = maybe_h.value();
float s = maybe_s.value() / 100.0f;
float l = maybe_l.value() / 100.0f;
return Color::from_hsl(h, s, l);
return Color::from_hsl(static_cast<double>(h), static_cast<double>(s), static_cast<double>(l));
}
}
} else if (function.name().equals_ignoring_case("hsla")) {
@ -2240,7 +2240,7 @@ Optional<Color> Parser::parse_color(ParsingContext const&, StyleComponentValueRu
float s = maybe_s.value() / 100.0f;
float l = maybe_l.value() / 100.0f;
float a = maybe_a.value();
return Color::from_hsla(h, s, l, a);
return Color::from_hsla(static_cast<double>(h), static_cast<double>(s), static_cast<double>(l), static_cast<double>(a));
}
}
}