mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibWeb/CSS: Use double in CSSHWB::to_color()
See previous the commit description for more details about the floating points operations. The hwb test cases in `css-color-functions` are now rendered identically to what firefox does (I haven't checked the others tests, but they aren't affected by this commit).
This commit is contained in:
committed by
Sam Atkins
parent
d1120e1809
commit
a1687854ab
@@ -25,8 +25,8 @@ Color CSSHWB::to_color(Optional<Layout::NodeWithStyle const&>) const
|
||||
return Color(gray, gray, gray, to_byte(alpha_val));
|
||||
}
|
||||
|
||||
float value = 1 - b_val;
|
||||
float saturation = 1 - (w_val / value);
|
||||
auto value = 1 - b_val;
|
||||
auto saturation = 1 - (w_val / value);
|
||||
return Color::from_hsv(h_val, saturation, value).with_opacity(alpha_val);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user