Bug 176811

Summary: Web Inspector: Color created from an RGB/HSL triplet returns bad component arrays
Product: WebKit Reporter: Matt Baker <mattbaker>
Component: Web InspectorAssignee: Matt Baker <mattbaker>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, inspector-bugzilla-changes, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 176822    
Attachments:
Description Flags
Patch
none
Patch none

Description Matt Baker 2017-09-12 15:09:40 PDT
Summary:
Color created from an RGB/HSL triplet returns bad component arrays.

For example:

> color = new WI.Color(WI.Color.Format.RGB, [255, 0, 0])
> color.rgb
< [255, 0]

> color.rgba
< [255, 0, 0]

The results from storing the triplet in either `_rgba` or `_hsla`, which are both assumed to have a length of four.

The problem also causes unexpected results when converting a Color created from components to a string:

> color.toString()
< "rgba(255, 0, 0)"

> color.toString(WebInspector.Color.Format.ShortHEX)
< "rgba(255, 0, 0)"

We should be able to convert a Color created from components just as easily as one created using `fromString()`.
Comment 1 Radar WebKit Bug Importer 2017-09-12 15:10:34 PDT
<rdar://problem/34397529>
Comment 2 Matt Baker 2017-09-12 15:21:10 PDT
Created attachment 320571 [details]
Patch
Comment 3 Matt Baker 2017-09-12 15:23:44 PDT
Created attachment 320572 [details]
Patch
Comment 4 Joseph Pecoraro 2017-09-14 14:32:18 PDT
Comment on attachment 320572 [details]
Patch

r=me
Comment 5 WebKit Commit Bot 2017-09-14 15:01:29 PDT
Comment on attachment 320572 [details]
Patch

Clearing flags on attachment: 320572

Committed r222055: <http://trac.webkit.org/changeset/222055>
Comment 6 WebKit Commit Bot 2017-09-14 15:01:30 PDT
All reviewed patches have been landed.  Closing bug.