cleanup: Prefer using Color struct constructor

Instead of Color.from_pixel or Color.new as both would be removed
to simplify the Color API

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3367>
This commit is contained in:
Bilal Elmoussaoui
2024-06-11 02:15:28 +02:00
committed by Marge Bot
parent cbf1d372f1
commit 4b3bbc50ff
4 changed files with 16 additions and 6 deletions

View File

@ -149,7 +149,12 @@ class WindowDimmer extends Clutter.BrightnessContrastEffect {
setDimmed(dimmed, animate) {
let val = 127 * (1 + (dimmed ? 1 : 0) * DIM_BRIGHTNESS);
let color = Clutter.Color.new(val, val, val, 255);
const color = new Clutter.Color({
red: val,
green: val,
blue: val,
alpha: 255,
});
this.actor.ease_property(`@effects.${this.name}.brightness`, color, {
mode: Clutter.AnimationMode.LINEAR,