LibGfx: Round values in Color::from_hsv()

This commit is contained in:
Lucas CHOLLET 2024-11-18 00:08:26 -05:00 committed by Sam Atkins
commit b4ba65c6e5
Notes: github-actions[bot] 2024-11-21 12:01:04 +00:00
3 changed files with 14 additions and 3 deletions

View file

@ -549,9 +549,9 @@ public:
break;
}
u8 out_r = (u8)(r * 255);
u8 out_g = (u8)(g * 255);
u8 out_b = (u8)(b * 255);
auto out_r = static_cast<u8>(round(r * 255));
auto out_g = static_cast<u8>(round(g * 255));
auto out_b = static_cast<u8>(round(b * 255));
return Color(out_r, out_g, out_b);
}