Commit 426c0fc6 authored by Paul Irish's avatar Paul Irish Committed by Commit Bot

DevTools: Restore colorpicker functionality on pre-m67 custom palettes

Bug:851311

Change-Id: Ia13bc1f082b69f37ee8ca65ac467cea166c11a2b
Reviewed-on: https://chromium-review.googlesource.com/1120951
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: default avatarAndrey Lushnikov <lushnikov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572146}
parent 31f4d3d2
...@@ -463,7 +463,10 @@ ColorPicker.Spectrum = class extends UI.VBox { ...@@ -463,7 +463,10 @@ ColorPicker.Spectrum = class extends UI.VBox {
/** @type {!ColorPicker.Spectrum.Palette} */ /** @type {!ColorPicker.Spectrum.Palette} */
const defaultCustomPalette = {title: 'Custom', colors: [], colorNames: [], mutable: true}; const defaultCustomPalette = {title: 'Custom', colors: [], colorNames: [], mutable: true};
this._customPaletteSetting = Common.settings.createSetting('customColorPalette', defaultCustomPalette); this._customPaletteSetting = Common.settings.createSetting('customColorPalette', defaultCustomPalette);
this._palettes.set(this._customPaletteSetting.get().title, this._customPaletteSetting.get()); const customPalette = this._customPaletteSetting.get();
// Fallback case for custom palettes created pre-m67
customPalette.colorNames = customPalette.colorNames || [];
this._palettes.set(customPalette.title, customPalette);
this._selectedColorPalette = this._selectedColorPalette =
Common.settings.createSetting('selectedColorPalette', ColorPicker.Spectrum.GeneratedPaletteTitle); Common.settings.createSetting('selectedColorPalette', ColorPicker.Spectrum.GeneratedPaletteTitle);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment