Skip to content

Commit cf8496b

Browse files
authored
Fix Shape tool custom color picker using gamma not linear space (#2773)
Fix colour space for options
1 parent ecd7999 commit cf8496b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

editor/src/messages/tool/tool_messages/shape_tool.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ impl LayoutHolder for ShapeTool {
143143
true,
144144
|_| ShapeToolMessage::UpdateOptions(ShapeOptionsUpdate::FillColor(None)).into(),
145145
|color_type: ToolColorType| WidgetCallback::new(move |_| ShapeToolMessage::UpdateOptions(ShapeOptionsUpdate::FillColorType(color_type.clone())).into()),
146-
|color: &ColorInput| ShapeToolMessage::UpdateOptions(ShapeOptionsUpdate::FillColor(color.value.as_solid())).into(),
146+
|color: &ColorInput| ShapeToolMessage::UpdateOptions(ShapeOptionsUpdate::FillColor(color.value.as_solid().map(|color| color.to_linear_srgb()))).into(),
147147
));
148148

149149
widgets.push(Separator::new(SeparatorType::Unrelated).widget_holder());
@@ -154,7 +154,7 @@ impl LayoutHolder for ShapeTool {
154154
true,
155155
|_| ShapeToolMessage::UpdateOptions(ShapeOptionsUpdate::StrokeColor(None)).into(),
156156
|color_type: ToolColorType| WidgetCallback::new(move |_| ShapeToolMessage::UpdateOptions(ShapeOptionsUpdate::StrokeColorType(color_type.clone())).into()),
157-
|color: &ColorInput| ShapeToolMessage::UpdateOptions(ShapeOptionsUpdate::StrokeColor(color.value.as_solid())).into(),
157+
|color: &ColorInput| ShapeToolMessage::UpdateOptions(ShapeOptionsUpdate::StrokeColor(color.value.as_solid().map(|color| color.to_linear_srgb()))).into(),
158158
));
159159
widgets.push(Separator::new(SeparatorType::Unrelated).widget_holder());
160160
widgets.push(create_weight_widget(self.options.line_weight));

0 commit comments

Comments
 (0)