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

@ -818,7 +818,12 @@ export const QuickSettingsMenu = class extends PopupMenu.PopupMenu {
_setDimmed(dim) {
const val = 127 * (1 + (dim ? 1 : 0) * DIM_BRIGHTNESS);
const color = Clutter.Color.new(val, val, val, 255);
const color = new Clutter.Color({
red: val,
green: val,
blue: val,
alpha: 255,
});
this._boxPointer.ease_property('@effects.dim.brightness', color, {
mode: Clutter.AnimationMode.LINEAR,