It provides an api-like so other extensions can use the color picker.
let extension = Main.extensionManager && Main.extensionManager.lookup('color-picker@tuberry');
if (!extension || extension.state != ExtensionUtils.ExtensionState.ENABLED)
return;
extension.stateObj.pickAsync().then(color => {
log(color); // "#ffffff", "rgb(255, 255, 255)" or "hsl(0, 100%, 100%)"
}).catch(e => {
log(e); // "Error: Cancelled" if the user escaped without picking a color
});
The persistent mode is ignored and the color can be either the one that is picked or the one that is selected in the menu.
It provides an api-like so other extensions can use the color picker.
The persistent mode is ignored and the color can be either the one that is picked or the one that is selected in the menu.