From 60cc96d24357b89639aaa16b9e6c3d933ca051e0 Mon Sep 17 00:00:00 2001 From: MacDue Date: Mon, 3 Oct 2022 20:46:34 +0100 Subject: [PATCH] LibWeb: Support painting the `saturate()` filter effect --- Userland/Libraries/LibWeb/Painting/FilterPainting.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Painting/FilterPainting.cpp b/Userland/Libraries/LibWeb/Painting/FilterPainting.cpp index ef54070962..38abcfd482 100644 --- a/Userland/Libraries/LibWeb/Painting/FilterPainting.cpp +++ b/Userland/Libraries/LibWeb/Painting/FilterPainting.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -74,7 +75,11 @@ void apply_filter_list(Gfx::Bitmap& target_bitmap, Layout::Node const& node, Spa break; } case CSS::Filter::Color::Operation::Saturate: { - dbgln("TODO: Implement saturate() filter function!"); + // Saturates the input image. The passed parameter defines the proportion of the conversion. + // A value of 0% is completely un-saturated. A value of 100% leaves the input unchanged. + // Other values are linear multipliers on the effect. + // Values of amount over 100% are allowed, providing super-saturated results + apply_color_filter(Gfx::SaturateFilter { amount }); break; } default: