From efd716835d2a684861ea7396ecc66741a4cf06d4 Mon Sep 17 00:00:00 2001 From: Diogo Trindade Date: Sat, 30 May 2020 17:48:43 +0100 Subject: [PATCH 1/2] made color adjust sliders apply to the average color --- .../Settings/Layers/AmbilightLayerHandler.cs | 13 ++++++++++++- .../Settings/Layers/Control_AmbilightLayer.xaml | 4 ++-- Project-Aurora/Project-Aurora/Utils/BitmapUtils.cs | 12 ++++++------ 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Project-Aurora/Project-Aurora/Settings/Layers/AmbilightLayerHandler.cs b/Project-Aurora/Project-Aurora/Settings/Layers/AmbilightLayerHandler.cs index d35f95781..3110dd8c7 100644 --- a/Project-Aurora/Project-Aurora/Settings/Layers/AmbilightLayerHandler.cs +++ b/Project-Aurora/Project-Aurora/Settings/Layers/AmbilightLayerHandler.cs @@ -346,7 +346,18 @@ public override EffectLayer Render(IGameState gamestate) break; case AmbilightType.AverageColor: - ambilight_layer.Set(Properties.Sequence, BitmapUtils.GetAverageColor(screen)); + var average = BitmapUtils.GetAverageColor(screen); + + if (Properties.BrightenImage) + average = ColorUtils.ChangeBrightness(average, Properties.BrightnessChange); + + if (Properties.SaturateImage) + average = ColorUtils.ChangeSaturation(average, Properties.SaturationChange); + + if (Properties.HueShiftImage) + average = ColorUtils.ChangeHue(average, Properties.HueShiftAngle); + + ambilight_layer.Set(Properties.Sequence, average); break; } diff --git a/Project-Aurora/Project-Aurora/Settings/Layers/Control_AmbilightLayer.xaml b/Project-Aurora/Project-Aurora/Settings/Layers/Control_AmbilightLayer.xaml index c55876a54..d2d7b7c87 100644 --- a/Project-Aurora/Project-Aurora/Settings/Layers/Control_AmbilightLayer.xaml +++ b/Project-Aurora/Project-Aurora/Settings/Layers/Control_AmbilightLayer.xaml @@ -157,11 +157,11 @@ - +