HaikuControlLook: De-convolute edge color computation.

Previously it used "contrast" and "brightness" values that were
computed in strange ways. Now it behaves more like the other
color computation functions and deals with the "flags" directly.

Comparing many controls, colors on button frames in all states appear
to be the same (or nearly the same, within 1-2 RGB values) before
and after this change.


Change-Id: Ia6d696c29fc76c73c88cc97af97ea45e1ff089ff
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9321
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Augustin Cavalier
2025-06-17 23:00:59 +00:00
committed by waddlesplash
parent 0b9af29d07
commit 8de71284ed
2 changed files with 58 additions and 105 deletions
+2 -10
View File
@@ -347,14 +347,11 @@ protected:
float rightBottomRadius,
const rgb_color& base,
const rgb_color& background,
float contrast, float brightness = 1.0,
uint32 flags = 0,
uint32 borders = B_ALL_BORDERS);
void _DrawOuterResessedFrame(BView* view,
BRect& rect, const rgb_color& base,
float contrast = 1.0f,
float brightness = 1.0f,
uint32 flags = 0,
uint32 borders = B_ALL_BORDERS);
@@ -529,13 +526,8 @@ protected:
orientation orientation);
// Border color methods
rgb_color _EdgeLightColor(const rgb_color& base,
float contrast, float brightness,
uint32 flags);
rgb_color _EdgeShadowColor(const rgb_color& base,
float contrast, float brightness,
uint32 flags);
rgb_color _EdgeColor(const rgb_color& base,
bool shadow, uint32 flags);
rgb_color _FrameLightColor(const rgb_color& base,
uint32 flags);