mirror of
https://github.com/RGBCube/serenity
synced 2025-09-18 06:16:17 +00:00
LibGfx: Use gamma-corrected interpolation for color gradients
Switch over to gamma-aware interpolation. This causes color gradients to not look so dark in the middle. SIMD optimized code is provided for sse1 enabled builds. Fixes #1342.
This commit is contained in:
parent
7042490e41
commit
1b9a85e4f1
3 changed files with 165 additions and 21 deletions
|
@ -89,10 +89,10 @@ public:
|
|||
static constexpr Color from_rgb(unsigned rgb) { return Color(rgb | 0xff000000); }
|
||||
static constexpr Color from_rgba(unsigned rgba) { return Color(rgba); }
|
||||
|
||||
u8 red() const { return (m_value >> 16) & 0xff; }
|
||||
u8 green() const { return (m_value >> 8) & 0xff; }
|
||||
u8 blue() const { return m_value & 0xff; }
|
||||
u8 alpha() const { return (m_value >> 24) & 0xff; }
|
||||
constexpr u8 red() const { return (m_value >> 16) & 0xff; }
|
||||
constexpr u8 green() const { return (m_value >> 8) & 0xff; }
|
||||
constexpr u8 blue() const { return m_value & 0xff; }
|
||||
constexpr u8 alpha() const { return (m_value >> 24) & 0xff; }
|
||||
|
||||
void set_alpha(u8 value)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue