-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add variable swatches to color picker
https://bugs.webkit.org/show_bug.cgi?id=259120 rdar://112099603 Reviewed by Devin Rousso. Include known color variables within the color picker. Select variables based on selected element and sort them based on the HSL values. The colors are shown using the InlineSwatch class allowing developers to quickly select variable colors. Utilize the node styles of an element to gather color variable information and sort based on visual appearance. Future work could aggregate more sources of color data and add new sorting patterns. Rewrote InlineSwatch to allow swapping between multiple swatch types. Added ColorSwatchDisplay to show all swatches. Altered ColorPicker communication pattern with InlineSwatch. * Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js: * Source/WebInspectorUI/UserInterface/Views/ColorPicker.css: (.color-picker): (.color-picker > .variable-color-swatches): (.color-picker > .variable-color-swatches > ul): (.color-picker > .variable-color-swatches > ul > li): (.color-picker > .variable-color-swatches > ul > li > .inline-swatch): (.color-picker > .variable-color-swatches > h2): * Source/WebInspectorUI/UserInterface/Views/ColorPicker.js: (WI.ColorPicker.prototype.async colorInputsWrapperElement): (WI.ColorPicker.sortColorVariables.visualAppeal): (WI.ColorPicker.sortColorVariables): (WI.ColorPicker.prototype._updateColorForVariable): (WI.ColorPicker): (WI.ColorPicker.get element): Deleted. (WI.ColorPicker.get colorSquare): Deleted. (WI.ColorPicker.set opacity): Deleted. (WI.ColorPicker.get color): Deleted. (WI.ColorPicker.set color): Deleted. * Source/WebInspectorUI/UserInterface/Views/InlineSwatch.css: (.inline-swatch): * Source/WebInspectorUI/UserInterface/Views/InlineSwatch.js: (WI.InlineSwatch.prototype.switch): (WI.InlineSwatch.prototype._updateSwatch): (WI.InlineSwatch.prototype._valueEditorValueDidChange): (WI.InlineSwatch.prototype._findMatchingColorVariable): (WI.InlineSwatch): * Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype.inlineSwatchGetColorVariables): (WI.SpreadsheetStyleProperty.prototype._createInlineSwatch): (WI.SpreadsheetStyleProperty.prototype._addVariableTokens): Canonical link: https://commits.webkit.org/266794@main
- Loading branch information
1 parent
2e4cd29
commit 3afcee6
Showing
6 changed files
with
204 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.