aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sway/commands/output/color_profile.c13
-rw-r--r--sway/sway-output.5.scd4
2 files changed, 13 insertions, 4 deletions
diff --git a/sway/commands/output/color_profile.c b/sway/commands/output/color_profile.c
index 98481329..b145d449 100644
--- a/sway/commands/output/color_profile.c
+++ b/sway/commands/output/color_profile.c
@@ -59,13 +59,21 @@ struct cmd_results *output_cmd_color_profile(int argc, char **argv) {
return cmd_results_new(CMD_INVALID, "Missing color_profile first argument.");
}
- if (strcmp(*argv, "srgb") == 0) {
+ if (strcmp(*argv, "gamma22") == 0) {
wlr_color_transform_unref(config->handler_context.output_config->color_transform);
config->handler_context.output_config->color_transform = NULL;
config->handler_context.output_config->set_color_transform = true;
config->handler_context.leftovers.argc = argc - 1;
config->handler_context.leftovers.argv = argv + 1;
+ } else if (strcmp(*argv, "srgb") == 0) {
+ wlr_color_transform_unref(config->handler_context.output_config->color_transform);
+ config->handler_context.output_config->color_transform =
+ wlr_color_transform_init_linear_to_inverse_eotf(WLR_COLOR_TRANSFER_FUNCTION_SRGB);
+ config->handler_context.output_config->set_color_transform = true;
+
+ config->handler_context.leftovers.argc = argc - 1;
+ config->handler_context.leftovers.argv = argv + 1;
} else if (strcmp(*argv, "icc") == 0) {
if (argc < 2) {
return cmd_results_new(CMD_INVALID,
@@ -106,7 +114,8 @@ struct cmd_results *output_cmd_color_profile(int argc, char **argv) {
config->handler_context.leftovers.argv = argv + 2;
} else {
return cmd_results_new(CMD_INVALID,
- "Invalid color profile specification: first argument should be icc|srgb");
+ "Invalid color profile specification: "
+ "first argument should be gamma22|icc|srgb");
}
return NULL;
diff --git a/sway/sway-output.5.scd b/sway/sway-output.5.scd
index cc48589c..afe21364 100644
--- a/sway/sway-output.5.scd
+++ b/sway/sway-output.5.scd
@@ -178,8 +178,8 @@ must be separated by one space. For example:
updated to work with different bit depths. This command is experimental,
and may be removed or changed in the future.
-*output* <name> color_profile srgb|[icc <file>]
- Sets the color profile for an output. The default is _srgb_. <file> should be a
+*output* <name> color_profile gamma22|srgb|[icc <file>]
+ Sets the color profile for an output. The default is _gamma22_. <file> should be a
path to a display ICC profile.
Not all renderers support this feature; currently it only works with the