From 3d5fce1b9f27e80a92af070a04ccf0cb39c774b1 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 2 Jun 2024 08:45:09 -0400 Subject: [PATCH] Fix a bug in color conversion The linear space corresponding to oklab is oklab, not srgb-linear. --- gtk/gtkcsscolor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/gtkcsscolor.c b/gtk/gtkcsscolor.c index 053d5a0296..66830ad5fd 100644 --- a/gtk/gtkcsscolor.c +++ b/gtk/gtkcsscolor.c @@ -321,7 +321,8 @@ convert_linear_to_linear (GtkCssColor *output, GtkCssColorSpace dest_linear; float v[4]; - if (dest == GTK_CSS_COLOR_SPACE_OKLCH) + if (dest == GTK_CSS_COLOR_SPACE_OKLCH || + dest == GTK_CSS_COLOR_SPACE_OKLAB) dest_linear = GTK_CSS_COLOR_SPACE_OKLAB; else dest_linear = GTK_CSS_COLOR_SPACE_SRGB_LINEAR;