mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Revert "More accurate 8-bit <=> 5-bit RGB color conversion (#1827)"
This reverts commit 223b3d1921.
This commit is contained in:
@@ -50,10 +50,9 @@ uint16_t Rgba::cgbColor() const {
|
||||
g = reverse_curve[g];
|
||||
b = reverse_curve[b];
|
||||
} else {
|
||||
constexpr auto _8to5 = [](uint8_t c) -> uint8_t { return (c * 31 + 127) / 255; };
|
||||
r = _8to5(r);
|
||||
g = _8to5(g);
|
||||
b = _8to5(b);
|
||||
r >>= 3;
|
||||
g >>= 3;
|
||||
b >>= 3;
|
||||
}
|
||||
return r | g << 5 | b << 10;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user