Web Inspector: change WI.ColorWheel to use conic-gradient()
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Oct 2018 22:15:16 +0000 (22:15 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Oct 2018 22:15:16 +0000 (22:15 +0000)
commite1fda25ba9c7b122fbed1d9e0b3847863398c968
tree2d28638418a70f324a5c3cf9a0355cbc32f241d8
parent02f4d260c1dd45d9bfab3fee7cdc177250a54f65
Web Inspector: change WI.ColorWheel to use conic-gradient()
https://bugs.webkit.org/show_bug.cgi?id=189485

Reviewed by Brian Burg.

Use the ("new") HSL `WI.ColorPicker` if `conic-gradient` is supported. Otherwise, use the
("old") RGB `WI.LegacyColorPicker`.

* UserInterface/Views/ColorWheel.js:
(WI.ColorWheel):
(WI.ColorWheel.prototype.set dimension):
(WI.ColorWheel.prototype.set brightness):
(WI.ColorWheel.prototype.get tintedColor):
(WI.ColorWheel.prototype.set tintedColor):
(WI.ColorWheel.prototype.get rawColor):
(WI.ColorWheel.prototype.get _hue): Added.
(WI.ColorWheel.prototype.get _saturation): Added.
(WI.ColorWheel.prototype._updateColorForMouseEvent):
(WI.ColorWheel.prototype._setCrosshairPosition):
(WI.ColorWheel.prototype._updateGradient): Added.
(WI.ColorWheel.prototype._pointInCircleForEvent.distance): Deleted.
(WI.ColorWheel.prototype._pointInCircleForEvent.angleFromCenterToPoint): Deleted.
(WI.ColorWheel.prototype._pointInCircleForEvent.pointOnCircumference): Deleted.
(WI.ColorWheel.prototype._pointInCircleForEvent): Deleted.
(WI.ColorWheel.prototype._tintedColorToPointAndBrightness): Deleted.
(WI.ColorWheel.prototype._drawRawCanvas): Deleted.
(WI.ColorWheel.prototype._colorAtPointWithBrightness): Deleted.
(WI.ColorWheel.prototype._drawTintedCanvas): Deleted.
(WI.ColorWheel.prototype._draw): Deleted.
* UserInterface/Views/ColorWheel.css:
(.color-wheel > .gradient): Added.
(.color-wheel > .crosshair): Added.

* UserInterface/Views/LegacyColorWheel.js: Copied from Source/WebInspectorUI/UserInterface/Views/ColorWheel.js.

* UserInterface/Views/ColorPicker.js:
(WI.ColorPicker):
(WI.ColorPicker.supportsConicGradient): Added.
(WI.ColorPicker.prototype._updateSliders):

* UserInterface/Models/Geometry.js:
(WI.Point.prototype.distance):

* UserInterface/Main.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237605 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Main.html
Source/WebInspectorUI/UserInterface/Models/Geometry.js
Source/WebInspectorUI/UserInterface/Views/ColorPicker.js
Source/WebInspectorUI/UserInterface/Views/ColorWheel.css
Source/WebInspectorUI/UserInterface/Views/ColorWheel.js
Source/WebInspectorUI/UserInterface/Views/LegacyColorWheel.js [new file with mode: 0644]