Web Inspector: conic-gradient color picker doesn't accurately show color when saturat...
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Jan 2019 21:58:23 +0000 (21:58 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Jan 2019 21:58:23 +0000 (21:58 +0000)
commitee60e38460bf8066ff5ecc2c12b2b9ff4bed420c
tree39f3bfaa222464d7888058c7294dece0d0a980cd
parent87fb6e6668851356584133f9dd350d398c1f658e
Web Inspector: conic-gradient color picker doesn't accurately show color when saturation value is not 100%
https://bugs.webkit.org/show_bug.cgi?id=192729
<rdar://problem/46746815>

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

Rework `WI.ColorWheel` to use similar canvas drawing logic as `WI.LegacyColorWheel` so that
it's able to adjust the saturation value as the pixels gets closer to the center.

* UserInterface/Models/Color.js:
(WI.Color.rgb2hsl): Added.
(WI.Color.hsl2rgb): Added.
(WI.Color.cmyk2rgb):
(WI.Color.prototype.isKeyword):
(WI.Color.prototype._toRGBString):
(WI.Color.prototype._toRGBAString):
(WI.Color.prototype._toHSLString):
(WI.Color.prototype._toHSLAString):
(WI.Color.prototype._rgbaToHSLA):
(WI.Color.prototype._hslaToRGBA):
(WI.Color.rgb2hsv): Deleted.
(WI.Color.hsv2rgb): Deleted.
(WI.Color.prototype._rgbToHSL): Deleted.
(WI.Color.prototype._hslToRGB): Deleted.
Adjust the conversion functions of `WI.Color` to be more accurate.

* 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._updateColorForMouseEvent):
(WI.ColorWheel.prototype._updateCanvas): Added.
(WI.ColorWheel.prototype._updateGradient): Deleted.
* UserInterface/Views/ColorWheel.css:
(.color-wheel > canvas): Added.
(.color-wheel > .gradient): Deleted.

* UserInterface/Views/ColorPicker.js:
(WI.ColorPicker):
(WI.ColorPicker.prototype.set color):
(WI.ColorPicker.prototype.sliderValueDidChange):
(WI.ColorPicker.prototype._updateSliders):
(WI.ColorPicker.prototype._showColorComponentInputs):
(WI.ColorPicker.supportsConicGradient): Deleted.

* UserInterface/Main.html:

* UserInterface/Views/LegacyColorWheel.js: Removed.

LayoutTests:

* inspector/model/color.html:
* inspector/model/color-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239597 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/model/color-expected.txt
LayoutTests/inspector/model/color.html
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Main.html
Source/WebInspectorUI/UserInterface/Models/Color.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 [deleted file]