UI: Theme: Make nodes use the exact theme color

Make node headers (or body when collapsed) use the exact theme color
set for that node type, instead of a hardcoded blend between it and the
node backdrop.

This can result in unreadable combinations, but allows more
flexibility and it is consistent with the rest of Blender.

Both dark and light theme defaults have been updated.

See PR for details and screenshots.

Pull Request: https://projects.blender.org/blender/blender/pulls/140481
This commit is contained in:
Pablo Vazquez
2025-06-16 18:34:29 +02:00
committed by Pablo Vazquez
parent b10b2d509c
commit 2ea3cd2188
5 changed files with 47 additions and 30 deletions

View File

@@ -804,23 +804,23 @@ const bTheme U_theme_default = {
.grid_levels = 3,
.dash_alpha = 0.5f,
.syntaxl = RGBA(0x303030ff),
.syntaxs = RGBA(0x973c3cff),
.syntaxb = RGBA(0xcccc00ff),
.syntaxn = RGBA(0xff3371ff),
.syntaxv = RGBA(0x12adffff),
.syntaxc = RGBA(0x3b660aff),
.syntaxd = RGBA(0x4c9797ff),
.syntaxs = RGBA(0x5a3838ff),
.syntaxb = RGBA(0x6e6e23ff),
.syntaxn = RGBA(0x82354cff),
.syntaxv = RGBA(0x246283ff),
.syntaxc = RGBA(0x374725ff),
.syntaxd = RGBA(0x3e5a5bff),
.syntaxr = RGBA(0x8d8d8dff),
.nodeclass_output = RGBA(0x4d0017ff),
.nodeclass_filter = RGBA(0x551a80ff),
.nodeclass_vector = RGBA(0x4d4dffff),
.nodeclass_texture = RGBA(0xe66800ff),
.nodeclass_shader = RGBA(0x24b524ff),
.nodeclass_script = RGBA(0x084d4dff),
.nodeclass_output = RGBA(0x3e232aff),
.nodeclass_filter = RGBA(0x412b51ff),
.nodeclass_vector = RGBA(0x3c3c83ff),
.nodeclass_texture = RGBA(0x79461dff),
.nodeclass_shader = RGBA(0x2b652bff),
.nodeclass_script = RGBA(0x203c3cff),
.nodeclass_pattern = RGBA(0x6c696fff),
.nodeclass_layout = RGBA(0x6c696fff),
.nodeclass_geometry = RGBA(0x00d6a3ff),
.nodeclass_attribute = RGBA(0x001566ff),
.nodeclass_geometry = RGBA(0x1d725eff),
.nodeclass_attribute = RGBA(0x1d2546ff),
.node_zone_simulation = RGBA(0x66416233),
.node_zone_repeat = RGBA(0x76512f33),
.node_zone_foreach_geometry_element = RGBA(0x33527f33),

View File

@@ -925,26 +925,26 @@
wire_select="#ffffffb3"
selected_text="#7f7f7f"
node_backdrop="#666666ff"
converter_node="#12adff"
color_node="#cccc00"
group_node="#3b660a"
converter_node="#4482a3"
color_node="#8e8e3f"
group_node="#566643"
group_socket_node="#000000"
frame_node="#0f0f0fcc"
matte_node="#973c3c"
distor_node="#4c9797"
matte_node="#7a5656"
distor_node="#5d7a7a"
noodle_curving="4"
grid_levels="3"
dash_alpha="0.5"
input_node="#ff3371"
output_node="#4d0017"
filter_node="#551a80"
vector_node="#4d4dff"
texture_node="#e66800"
shader_node="#24b524"
script_node="#084d4d"
input_node="#a2536a"
output_node="#5d4048"
filter_node="#5f4a70"
vector_node="#5c5ca3"
texture_node="#99673d"
shader_node="#4c864c"
script_node="#405c5c"
pattern_node="#6c696f"
layout_node="#6c696f"
geometry_node="#00d6a3"
geometry_node="#3d937e"
attribute_node="#001566"
simulation_zone="#66416233"
repeat_zone="#76512f33"

View File

@@ -27,7 +27,7 @@
/* Blender file format version. */
#define BLENDER_FILE_VERSION BLENDER_VERSION
#define BLENDER_FILE_SUBVERSION 11
#define BLENDER_FILE_SUBVERSION 12
/* Minimum Blender version that supports reading file written with the current
* version. Older Blender versions will test this and cancel loading the file, showing a warning to

View File

@@ -300,6 +300,23 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
FROM_DEFAULT_V4_UCHAR(tui.panel_sub_back);
}
if (!USER_VERSION_ATLEAST(500, 12)) {
FROM_DEFAULT_V4_UCHAR(space_node.syntaxs);
FROM_DEFAULT_V4_UCHAR(space_node.syntaxb);
FROM_DEFAULT_V4_UCHAR(space_node.syntaxn);
FROM_DEFAULT_V4_UCHAR(space_node.syntaxv);
FROM_DEFAULT_V4_UCHAR(space_node.syntaxc);
FROM_DEFAULT_V4_UCHAR(space_node.syntaxd);
FROM_DEFAULT_V4_UCHAR(space_node.nodeclass_attribute);
FROM_DEFAULT_V4_UCHAR(space_node.nodeclass_filter);
FROM_DEFAULT_V4_UCHAR(space_node.nodeclass_geometry);
FROM_DEFAULT_V4_UCHAR(space_node.nodeclass_output);
FROM_DEFAULT_V4_UCHAR(space_node.nodeclass_script);
FROM_DEFAULT_V4_UCHAR(space_node.nodeclass_shader);
FROM_DEFAULT_V4_UCHAR(space_node.nodeclass_texture);
FROM_DEFAULT_V4_UCHAR(space_node.nodeclass_vector);
}
/**
* Always bump subversion in BKE_blender_version.h when adding versioning
* code here, and wrap it inside a USER_VERSION_ATLEAST check.

View File

@@ -3487,7 +3487,7 @@ static void node_draw_basis(const bContext &C,
UI_GetThemeColorBlend4f(TH_BACK, color_id, 0.1f, color_header);
}
else {
UI_GetThemeColorBlend4f(TH_NODE, color_id, 0.4f, color_header);
UI_GetThemeColor4fv(color_id, color_header);
}
UI_draw_roundbox_corner_set(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT);
@@ -3869,7 +3869,7 @@ static void node_draw_hidden(const bContext &C,
rgba_float_args_set(color, node.color[0], node.color[1], node.color[2], 1.0f);
}
else {
UI_GetThemeColorBlend4f(TH_NODE, color_id, 0.4f, color);
UI_GetThemeColor4fv(color_id, color);
}
/* Draw selected nodes fully opaque. */