diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js index 33f5c86df..3173e0d17 100644 --- a/js/ui/lookingGlass.js +++ b/js/ui/lookingGlass.js @@ -38,7 +38,6 @@ var commandHeader = 'const Clutter = imports.gi.Clutter; ' + /* Utility functions...we should probably be able to use these * in the shell core code too. */ 'const stage = global.stage; ' + - 'const color = function(pixel) { let c= new Clutter.Color(); c.from_pixel(pixel); return c; }; ' + /* Special lookingGlass functions */ 'const it = Main.lookingGlass.getIt(); ' + 'const r = Lang.bind(Main.lookingGlass, Main.lookingGlass.getResult); '; diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js index f4440cd86..514dc0732 100644 --- a/js/ui/magnifier.js +++ b/js/ui/magnifier.js @@ -303,8 +303,7 @@ const Magnifier = new Lang.Class({ */ setCrosshairsColor: function(color) { if (this._crossHairs) { - let clutterColor = new Clutter.Color(); - clutterColor.from_string(color); + let [res, clutterColor] = Clutter.Color.from_string(color); this._crossHairs.setColor(clutterColor); } }, @@ -1472,9 +1471,7 @@ const Crosshairs = new Lang.Class({ * @color: The color as a Clutter.Color. */ getColor: function() { - let clutterColor = new Clutter.Color(); - this._horizLeftHair.get_color(clutterColor); - return clutterColor; + return this._horizLeftHair.get_color(); }, /** diff --git a/js/ui/main.js b/js/ui/main.js index 73112f33b..271d979c8 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -43,8 +43,7 @@ const XdndHandler = imports.ui.xdndHandler; const Util = imports.misc.util; const OVERRIDES_SCHEMA = 'org.gnome.shell.overrides'; -const DEFAULT_BACKGROUND_COLOR = new Clutter.Color(); -DEFAULT_BACKGROUND_COLOR.from_pixel(0x2266bbff); +const DEFAULT_BACKGROUND_COLOR = Clutter.Color.from_pixel(0x2266bbff); let automountManager = null; let autorunManager = null;