1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:17:35 +00:00

LibGfx/TinyVG: Fix decoding green channel of graphics RGB565 colors

The division was missed here, so this would produce overly bright greens
(or overflow).
This commit is contained in:
MacDue 2024-03-12 19:31:17 +00:00 committed by Sam Atkins
parent 633f0067c1
commit 4c15c87d0c
3 changed files with 12 additions and 1 deletions

View file

@ -147,7 +147,7 @@ static ErrorOr<Vector<Color>> decode_color_table(Stream& stream, ColorEncoding e
auto red = (color >> (6 + 5)) & 0x1f;
auto green = (color >> 5) & 0x3f;
auto blue = (color >> 0) & 0x1f;
return Color((red * 255 + 15) / 31, (green * 255 + 31), (blue * 255 + 15) / 31);
return Color((red * 255 + 15) / 31, (green * 255 + 31) / 63, (blue * 255 + 15) / 31);
}
case ColorEncoding::RGBAF32: {
auto red = TRY(stream.read_value<LittleEndian<f32>>());