mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +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:
parent
d1120e1809
commit
a1687854ab
Notes:
github-actions[bot]
2024-11-21 12:00:42 +00:00
Author: https://github.com/LucasChollet
Commit: a1687854ab
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2390
Reviewed-by: https://github.com/gmta
5 changed files with 29 additions and 6 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue