Revert "Fix: UI: Low contrast alert in drag-drop and tooltips"

This reverts commit db7b9f9b36.

This is causing other issues that are too risky to fix at this time in
the release cycle. A proper fix will be in 5.3.

# Conflicts:
#	source/blender/blenkernel/BKE_blender_version.h
This commit is contained in:
Pablo Vazquez 2026-06-18 11:15:38 +02:00
parent 4db30c1c78
commit 3cb431d137
4 changed files with 13 additions and 18 deletions

View file

@ -231,7 +231,7 @@ const bTheme U_theme_default = {
},
.link = RGBA(0x6FA9E6ff),
.wcol_state = {
.error = RGBA(0xb30000ff),
.error = RGBA(0x991616ff),
.warning = RGBA(0xac8737ff),
.info = RGBA(0x28487dff),
.success = RGBA(0x188625ff),

View file

@ -347,7 +347,7 @@
</wcol_list_item>
<wcol_state>
<ThemeWidgetStateColors
error="#D40000ff"
error="#991616ff"
warning="#ac8737ff"
info="#28487dff"
success="#188625ff"

View file

@ -3148,20 +3148,13 @@ static void widget_state(WidgetType *wt, const WidgetStateInfo *state, EmbossTyp
if (state->but_flag & BUT_REDALERT) {
if (wt->draw && emboss != EmbossType::None) {
uchar red[4];
theme::get_color_3ubv(TH_REDALERT, red);
/* Outline uses a mix to emphasize it a bit. */
color_blend_v3_v3(wt->wcol.outline, red, 0.6f);
/* Darken the alert for the inner color. */
color_mul_hsl_v3(red, 1.0f, 1.0f, 0.6f);
copy_v3_v3_uchar(wt->wcol.inner, red);
theme::get_color_3ubv(TH_REDALERT, wt->wcol.inner);
}
else {
uchar red[4];
theme::get_color_3ubv(TH_REDALERT, red);
color_mul_hsl_v3(red, 1.0f, 1.5f, 1.5f);
color_blend_v3_v3(wt->wcol.text, red, 0.6f);
color_blend_v3_v3(wt->wcol.text, red, 0.5f);
}
}
@ -5016,7 +5009,7 @@ static void widget_state_label(WidgetType *wt, const WidgetStateInfo *state, Emb
uchar red[4];
theme::get_color_3ubv(TH_REDALERT, red);
color_mul_hsl_v3(red, 1.0f, 1.5f, 1.5f);
color_blend_v3_v3(wt->wcol.text, red, 0.6f);
color_blend_v3_v3(wt->wcol.text, red, 0.5f);
}
}

View file

@ -1145,14 +1145,16 @@ static void wm_drop_redalert_draw(const StringRef redalert_str, int x, int y)
const bTheme *btheme = ui::theme::theme_get();
const uiWidgetColors *wcol = &btheme->tui.wcol_tooltip;
float col_fg[4], col_bg[4];
float col_fg[4], col_bg[4], col_alert[4];
rgba_uchar_to_float(col_bg, wcol->inner);
rgba_uchar_to_float(col_fg, wcol->text);
ui::theme::get_color_4fv(TH_REDALERT, col_alert);
ui::theme::get_color_4fv(TH_REDALERT, col_fg);
/* Lighten the alert color a bit for the text. */
col_fg[0] = std::min(col_fg[0] + 0.2f, 1.0f);
col_fg[1] = std::min(col_fg[1] + 0.2f, 1.0f);
col_fg[2] = std::min(col_fg[2] + 0.2f, 1.0f);
/* Blend between the original text color and alert.
* This ensures the text be always readable, lighter or darker depending on the theme. */
col_fg[0] = (1.0f - 0.66f) * col_fg[0] + (0.66f * col_alert[0]);
col_fg[1] = (1.0f - 0.66f) * col_fg[1] + (0.66f * col_alert[1]);
col_fg[2] = (1.0f - 0.66f) * col_fg[2] + (0.66f * col_alert[2]);
ui::fontstyle_draw_simple_backdrop(fstyle, x, y, redalert_str, col_fg, col_bg);
}