Fix #134796: Adjust Error Theme Color for Widget Text

When using the Error theme color for widget text color, this has to be
altered to provide sufficient contrast with other content.  This was
done with label text color, before recent changes to make these colors
themeable, by blending with text color. This PR makes similar changes
and gives similar results.

Pull Request: https://projects.blender.org/blender/blender/pulls/134807
This commit is contained in:
Harley Acheson
2025-02-19 20:24:33 +01:00
committed by Harley Acheson
parent 9a36b800eb
commit 2e90aace03

View File

@@ -2541,7 +2541,10 @@ static void widget_state(uiWidgetType *wt, const uiWidgetStateInfo *state, eUIEm
UI_GetThemeColor3ubv(TH_REDALERT, wt->wcol.inner);
}
else {
UI_GetThemeColor3ubv(TH_REDALERT, wt->wcol.text);
uchar red[4];
UI_GetThemeColor3ubv(TH_REDALERT, red);
color_mul_hsl_v3(red, 1.0f, 1.5f, 1.5f);
color_blend_v3_v3(wt->wcol.text, red, 0.5f);
}
}
@@ -4351,7 +4354,10 @@ static void widget_state_label(uiWidgetType *wt,
}
if (state->but_flag & UI_BUT_REDALERT) {
UI_GetThemeColor3ubv(TH_REDALERT, wt->wcol.text);
uchar red[4];
UI_GetThemeColor3ubv(TH_REDALERT, red);
color_mul_hsl_v3(red, 1.0f, 1.5f, 1.5f);
color_blend_v3_v3(wt->wcol.text, red, 0.5f);
}
}