Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2022-06-29 14:01:38 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-06-29 18:08:50 +0300
commit6b508eb012b929b34e893f71a785580562cc9a6a (patch)
tree37cd279a588e7b6f187163208af29466f2f3124d /source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc
parent6dd8ceef2a21f64cbb61a96560c50c162f9dae39 (diff)
Spreadsheet: display byte colors as scene linear floats
The compression as sRGB is mostly an implementation detail and showing the integers does not make it clear what the actual values are that will be used for computations in geometry nodes. This follows the general convention that colors in Blender are displayed and edited in scene linear floats. The raw sRGB bytes can still be viewed as a tooltip. Ref T99205 Differential Revision: https://developer.blender.org/D15322
Diffstat (limited to 'source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc')
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc19
1 files changed, 3 insertions, 16 deletions
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc b/source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc
index 6d8febc0e45..548e6cf29e4 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc
@@ -90,7 +90,8 @@ static std::string value_string(const SpreadsheetRowFilter &row_filter,
return row_filter.value_string;
}
return "";
- case SPREADSHEET_VALUE_TYPE_COLOR: {
+ case SPREADSHEET_VALUE_TYPE_COLOR:
+ case SPREADSHEET_VALUE_TYPE_BYTE_COLOR: {
std::ostringstream result;
result.precision(3);
result << std::fixed << "(" << row_filter.value_color[0] << ", " << row_filter.value_color[1]
@@ -99,14 +100,6 @@ static std::string value_string(const SpreadsheetRowFilter &row_filter,
}
case SPREADSHEET_VALUE_TYPE_STRING:
return row_filter.value_string;
- case SPREADSHEET_VALUE_TYPE_BYTE_COLOR: {
- std::ostringstream result;
- result.precision(3);
- result << std::fixed << "(" << (int)row_filter.value_byte_color[0] << ", "
- << (int)row_filter.value_byte_color[1] << ", " << (int)row_filter.value_byte_color[2]
- << ", " << (int)row_filter.value_byte_color[3] << ")";
- return result.str();
- }
case SPREADSHEET_VALUE_TYPE_UNKNOWN:
return "";
}
@@ -233,6 +226,7 @@ static void spreadsheet_filter_panel_draw(const bContext *C, Panel *panel)
uiItemR(layout, filter_ptr, "value_string", 0, IFACE_("Value"), ICON_NONE);
break;
case SPREADSHEET_VALUE_TYPE_COLOR:
+ case SPREADSHEET_VALUE_TYPE_BYTE_COLOR:
uiItemR(layout, filter_ptr, "operation", 0, nullptr, ICON_NONE);
uiItemR(layout, filter_ptr, "value_color", 0, IFACE_("Value"), ICON_NONE);
if (operation == SPREADSHEET_ROW_FILTER_EQUAL) {
@@ -242,13 +236,6 @@ static void spreadsheet_filter_panel_draw(const bContext *C, Panel *panel)
case SPREADSHEET_VALUE_TYPE_STRING:
uiItemR(layout, filter_ptr, "value_string", 0, IFACE_("Value"), ICON_NONE);
break;
- case SPREADSHEET_VALUE_TYPE_BYTE_COLOR:
- uiItemR(layout, filter_ptr, "operation", 0, nullptr, ICON_NONE);
- uiItemR(layout, filter_ptr, "value_byte_color", 0, IFACE_("Value"), ICON_NONE);
- if (operation == SPREADSHEET_ROW_FILTER_EQUAL) {
- uiItemR(layout, filter_ptr, "threshold", 0, nullptr, ICON_NONE);
- }
- break;
case SPREADSHEET_VALUE_TYPE_UNKNOWN:
uiItemL(layout, IFACE_("Unknown column type"), ICON_ERROR);
break;