[webkit-reviews] review granted: [Bug 206202] REGRESSION(r251487): Web Inspector: selected color in color picker has wrong lightness : [Attachment 387584] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 16 16:36:27 PST 2020


Devin Rousso <drousso at apple.com> has granted Nikita Vasilyev
<nvasilyev at apple.com>'s request for review:
Bug 206202: REGRESSION(r251487): Web Inspector: selected color in color picker
has wrong lightness
https://bugs.webkit.org/show_bug.cgi?id=206202

Attachment 387584: Patch

https://bugs.webkit.org/attachment.cgi?id=387584&action=review




--- Comment #4 from Devin Rousso <drousso at apple.com> ---
Comment on attachment 387584
  --> https://bugs.webkit.org/attachment.cgi?id=387584
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=387584&action=review

r=me

> Source/WebInspectorUI/UserInterface/Views/ColorSquare.js:109
> +	   let hsv = WI.Color.rgb2hsv(...tintedColor.normalizedRGB);

NIT: we can destructure this for better code clarity:
```
    let [hue, saturation] = WI.Color.rgb2hsv(...tintedColor.normalizedRGB);
    let x = hue / 100 * this._dimension;
    let y = (1 - (saturation / 100)) * this._dimension;
```

> Source/WebInspectorUI/UserInterface/Views/ColorSquare.js:112
> +	   this._setCrosshairPosition(new WI.Point(x, y));

This is called again below.  Please remove it, or add a comment explaining why
it has to be called twice.


More information about the webkit-reviews mailing list