Bug 203695

Summary: Web Inspector: Color picker: incorrect saturation when selecting color on color square
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Nikita Vasilyev <nvasilyev>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, inspector-bugzilla-changes, mattbaker, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[Image] Bug
none
Patch
mattbaker: review+
Patch none

Nikita Vasilyev
Reported 2019-10-31 13:43:57 PDT
Created attachment 382496 [details] [Image] Bug For instance, the top middle point of the color square should have: 100% saturation 75% lightness Instead, it shows: 50% saturation 75% lightness
Attachments
[Image] Bug (247.58 KB, image/png)
2019-10-31 13:43 PDT, Nikita Vasilyev
no flags
Patch (5.93 KB, patch)
2019-10-31 13:49 PDT, Nikita Vasilyev
mattbaker: review+
Patch (5.98 KB, patch)
2019-10-31 14:37 PDT, Nikita Vasilyev
no flags
Radar WebKit Bug Importer
Comment 1 2019-10-31 13:44:09 PDT
Nikita Vasilyev
Comment 2 2019-10-31 13:49:21 PDT
Matt Baker
Comment 3 2019-10-31 14:29:46 PDT
Comment on attachment 382498 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=382498&action=review r=me, looks good! > Source/WebInspectorUI/UserInterface/Models/Color.js:270 > + } Per our offline discussion, I agree that this reads closer to the conversion algorithm on Wikipedia: static hsv2hsl(h, s, v) { h = Number.constrain(h, 0, 360); s = Number.constrain(s, 0, 100) / 100; v = Number.constrain(v, 0, 100) / 100; let l = v - v * s / 2; let s; if (l === 0 || l === 1) s = 0; else s = (v - l) / Math.min(l, 1 - l); return [h, s * 100, l * 100]; }
Nikita Vasilyev
Comment 4 2019-10-31 14:37:00 PDT
WebKit Commit Bot
Comment 5 2019-10-31 15:26:19 PDT
Comment on attachment 382502 [details] Patch Clearing flags on attachment: 382502 Committed r251885: <https://trac.webkit.org/changeset/251885>
WebKit Commit Bot
Comment 6 2019-10-31 15:26:20 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.